Created
April 27, 2020 13:46
-
-
Save rishisidhu/66513e16dc627ef5bab5b88351c3778c to your computer and use it in GitHub Desktop.
javascript code to display the scope of var statement
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
// Var scope function | |
function varExample() { | |
for (var i = 0; i < 10; i++) { | |
console.log("i = ", i); | |
} | |
//console.log("i outside of scope = ", i); | |
} | |
function go() { | |
varExample(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment