Lets say I have a function look like this:
function foo()
{
console.log(arguments);
}
foo(event_1="1", event_2="2");
In this case the output will be:
[object Arguments] {
0: "1",
1: "2"
}
How can I get the key of the arguments (event_1, event_2) instead of (0,1)?
event_1andevent_2) are variable references and have nothing to do with the function invocation process (other than the incidental side effect of their being assigned values by the argument expressions).