Page 1 of 1

JS Equivilent of func_get_args()

Posted: Mon Jun 02, 2008 5:45 am
by Kadanis
Hey all,

I'm looking for a javascript equivalent of the php function func_get_args() so I can pass any number of arguments to the JS script.

Does any know if there is something like this and what it is?

Cheers

Re: JS Equivilent of func_get_args()

Posted: Mon Jun 02, 2008 5:49 am
by VladSun
http://www.devx.com/tips/Tip/13163
[js]function foo() {  var argv = foo.arguments;  var argc = argv.length;  for (var i = 0; i < argc; i++) {    alert("Argument " + i + " = " + argv);   }} foo('hello', 'world');[/js]

EDIT: Code pasted.

Re: JS Equivilent of func_get_args()

Posted: Mon Jun 02, 2008 6:00 am
by Kadanis
Brilliant. Thanks a million.