Let’s say you have
var funct=function(a,b){
return a+b;
};
console.log(funct);
Is there any way you can get the names of the arguments (a and b) from funct? If you are with in the function do you have any access to them? I know “arguments” gives you an array-like object, but is there anything that gives you a map-like or object-like representation of the arguments so that you can get their names when the function was declared?
One way is to turn the function into a string and parse it out
jsFiddle
Still have no clue why you would need it.