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
JS Equivilent of func_get_args()
Moderator: General Moderators
Re: JS Equivilent of func_get_args()
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.
[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.
Last edited by VladSun on Mon Jun 02, 2008 6:25 am, edited 1 time in total.
There are 10 types of people in this world, those who understand binary and those who don't
Re: JS Equivilent of func_get_args()
Brilliant. Thanks a million.