Last active
October 2, 2021 11:23
-
-
Save rahgurung/2928ce935fbf4b6ce0a4be14919efe98 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
function foo() { | |
var a = 2; | |
// This magically executes the bar() function | |
// we will explain this later in the article | |
this.bar(); | |
} | |
function bar() { | |
console.log(this.a); | |
} | |
foo(); // ReferenceError: a is not defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment