I'm not sure if this is a good idea or not, but I'd like to be able to get the name of a function from within it, while it is being called. The test code I wrote below seems to work, in that it doesn't cause a name clash, but I can't get the name of the function without knowing it first.
function And(){
return "test";
};
var X = {
And: function And(){
return this.And.name;
}
};
document.write(X.And());
Is there any way of achieving this that doesn't involve binding the context (i.e. the value of 'this') on the function?