How to get the the variable name from within a function in this example:
// it should return A var A = function(){ console.log(this.name); }
That function is anonymous; it has no name. You could, however, give it a name:
var A = function a() {};
Then its name is accessible via Function.name:
var A = function a() {}; A.name > 'a'