Created
December 26, 2017 05:49
-
-
Save PavanKu/2dc3acbcf3f4e925b9c39364b0ca08d0 to your computer and use it in GitHub Desktop.
Global value
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
var count = 5; | |
function test () { | |
console.log(this.count === 5); | |
} | |
test() // Prints true as “count” variable declaration happened in global execution context so count will become part of global object. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment