Skip to content

Instantly share code, notes, and snippets.

@rishisidhu
Created April 27, 2020 13:55
Show Gist options
  • Save rishisidhu/a3c12848fe938f72a925e6ef3c9bc7e1 to your computer and use it in GitHub Desktop.
Save rishisidhu/a3c12848fe938f72a925e6ef3c9bc7e1 to your computer and use it in GitHub Desktop.
Javascript code to display the scope of let statement
// Let scope function
function letExample() {
for (let i = 0; i < 10; i++) {
console.log("i = ", i);
}
console.log("i outside of scope = ", i);
}
function go() {
letExample();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment