Amin Ptc
Amin Ptc

Reputation: 13

Popping an array from local function in as2

Why does this pop method returns: [type Function]

var possibles:Array=new Array(1,2,3,4);
function testpop()
{
  trace( possibles.pop );
}
testpop();

This code written in action script 2

Upvotes: 1

Views: 83

Answers (1)

Andreas Louv
Andreas Louv

Reputation: 47137

Cause it's a function remember to call it:

var possibles:Array=new Array(1,2,3,4);
function testpop()
{
  trace( possibles.pop() );
}
testpop();

Upvotes: 1

Related Questions