Search posts, tags, users, and pages
If you are learning JavaScript or been into for a while, then you would have encountered a pretty tricky concept of JS. The concept of this. So, let us explore together what does this means. In JavaScript, this keyword refers to the object it belongs...
Pranav Bakale
@pranav1299 · India
I'm a Senior Frontend Developer. Exploring about Web, Next, React, JavaScript,etc
I'm a Senior Frontend Developer. I write about Web, Next, React, JavaScript, etc
Markdown supported · ⌘↵ to post
Sanjay Vyas
It differs in node.
this.count = 0; will not go to global dictionary, rather into the object for which the top level anonymous function is called.
console.log(global.count); // undefined console.log(this); // { count: 0 }
Yes, it differs in node. Thank you so much for sharing this.
Sanjay Vyas
It differs in node.
this.count = 0; will not go to global dictionary, rather into the object for which the top level anonymous function is called.
console.log(global.count); // undefined console.log(this); // { count: 0 }