ce****@gmail.com said on 07/04/2006 1:02 PM AEST:
I think I found what I need. Check it out:
http://wp.netscape.com/eng/mozilla/3..._a-c.htm#42839
That documentation is old, it appears to be targeted at Navigator 3
which was first released in about 1994.
The arguments object is not an array, it is a list. It is like an array
as it has properties that can be referenced by index and it has a length
equal to the number of arguments provided to the function. But it
doesn't have any of an array's special methods like join, concat, pop,
and so on.
Do not prefix 'arguments' with the function name, just call it with
'arguments':
function someFunc()
{
for (var i=0, len=arguments.length; i<len; ++i)
{
alert( 'Argument ' + i + ': ' + arguments[i] );
}
}
someFunc('arg0', 'arg1', 'arg2');
An 'arguments' object is also created for anonymous objects where it can
be accessed exactly as above:
var aFunc = function()
{
for (var i=0, len=arguments.length; i<len; ++i)
{
alert( 'Argument ' + i + ': ' + arguments[i] );
}
}
aFunc('A', 'B', 'C');
--
Rob
Group FAQ: <URL:http://www.jibbering.com/FAQ>