Imagine having an object like this:
var app = {}
inside which there is a method:
app = {
initialize: function () {
}
}
Is it possible to retrieve the name of the method 'initialize'
from within the initialize()
function without explicitly searching for 'initialize'
? This is in the scenario where the method name can vary and cannot be assumed beforehand.
app = {
initialize: function () {
// access method name 'initialize' here
}
}
app.initialize();
I attempted using callee
but it only returns an empty string