manju4ever
manju4ever

Reputation: 325

How come if this is a reserved word in javascript, i'm still able to set it as a property?

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

Answers (1)

Related Questions