Is it possible to reference this function's name? For example:
'use strict'
function myClass(){}
myClass.prototype.myName = function myName(data,callback){
console.log("This function has been called: " + "{???}"); // "myName"
}
myClass.prototype.myAge = function(data,callback){
console.log("This function has been called: " + "{???}"); // "myAge"
}
var a = new myClass();
a.myName(); // 'myName'
a.myAge(); // 'myAge';
How can I reference "myName" in strict mode like that?
myNameproperty or the named function? You can clarify by not making the function name and the property names the sameconsole.log.Errorinstance and get a stack trace.