Skip to content

A simple project to clarify "this" keyword evaluation in Javascript

Notifications You must be signed in to change notification settings

ericchaves/this_context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Understanding This context

This project ilustrates the different contexts for this keyword in nodejs. It's based on the exceltent article Fully Understanding the this Keyword which I higly recommend reading. I also highly recommend the MDN article on this keyword and for a complete understanding of prototype chain, the Yehuda Kat'z article Understanding prototypes in javascript.

tl;dr

As per ECMAScript, when "this" is called outside of any function it references the global context. This situation is a little harder to exploit in node.js since all module calls are embedded in a function to protect the global scope.

About

A simple project to clarify "this" keyword evaluation in Javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published