Skip to content

Instantly share code, notes, and snippets.

@rishisidhu
Created April 27, 2020 13:46
Show Gist options
  • Save rishisidhu/66513e16dc627ef5bab5b88351c3778c to your computer and use it in GitHub Desktop.
Save rishisidhu/66513e16dc627ef5bab5b88351c3778c to your computer and use it in GitHub Desktop.
javascript code to display the scope of var statement
// 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