Last active
July 25, 2018 17:25
-
-
Save rrameshbtech/ca9ac1e9d09cd451264855d3e2511e8b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run it in Browser | |
function thisInBrowser() { | |
console.log(this === window); // true | |
} | |
thisInBrowser(); | |
//Run it in Node.js | |
function thisInNodeJS() { | |
console.log(this === global); // true | |
} | |
thisInNodeJS(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment