Is it possible to get all arguments of a function as single object inside that function?

rsk82 picture rsk82 · Jan 8, 2011 · Viewed 180.2k times · Source

In PHP there is func_num_args and func_get_args, is there something similar for JavaScript?

Answer

Thomas Eding picture Thomas Eding · Jan 8, 2011

Use arguments. You can access it like an array. Use arguments.length for the number of arguments.