Skip to content

Instantly share code, notes, and snippets.

@PavanKu
Created December 26, 2017 05:49
Show Gist options
  • Save PavanKu/2dc3acbcf3f4e925b9c39364b0ca08d0 to your computer and use it in GitHub Desktop.
Save PavanKu/2dc3acbcf3f4e925b9c39364b0ca08d0 to your computer and use it in GitHub Desktop.
Global value
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