Last active
March 28, 2017 05:59
-
-
Save abhinavdhasmana/209fb3ce9e93e8686b008f8310a05d78 to your computer and use it in GitHub Desktop.
This file contains 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
'use strict'; | |
function whoAmI() { | |
console.log('I am in local scope:', this); | |
} | |
console.log('I am in global scope:', this); | |
whoAmI(); | |
// Output in Node | |
// I am in global scope: {} | |
// I am in local scope: undefined | |
// Output in Chrome console | |
// I am in global scope: <Window Object> | |
// I am in local scope: undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment