Here's a clear demo of that:
function one( ary1 )
ary1 = "banana pudding";
ary1 = "zamboni";
function two( ary2 )
alert( ary2.join("\n") );
var ary = [ 1, 2, 3 ];
one( ary );
two( ary );
As you can see, the array ary
is *NOT* a global. Yet when we pass it to function one( )
it's first element is changed, as is proven when we then pass the same variable to function two( )
And, as you can see, we can even add elements to the array and the added elements are carried back to the caller and then to the second callee.
THERE IS ONLY ONE ARRAY in all that code. The names ary
are all actually referencing the same array.