Possible Duplicate:
Get variable name. javascript “reflection”
Is there a way to know the name of a variable?
Example:
var a = 1;
var b = 4;
function getName(param){
//What should I return here?
}
What I want to do, is to have getName
return "a" if I call getName(a)
and return "b" if I call getName(b)
Is this possible?