Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function foo () {
console.log(this.a) // 3
}
var a = 3 // because this reference the global object and here our var 'a' is global variable.
foo()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.