Reputation: 325
Well this time, there was some interesting behavior that i observed, i would defeinitely like to know more.
var doStuff = function() {
this.this = function() {
console.log("I'm the other this");
}
this.this(); //Is this legal to be used ?
};
doStuff.call(null);
Output
I'm the other this
Upvotes: 0
Views: 39
Reputation: 5963
'The syntactic grammar defines Identifier as an IdentifierName that is not a ReservedWord (see 11.6.2)' However object properties can be accessed with MemberExpression . IdentifierName
, and IdentifierNames aren't subject to that restriction.
Upvotes: 2