Skip to content

Instantly share code, notes, and snippets.

@Nathan-Nesbitt
Created May 7, 2020 18:27
Show Gist options
  • Select an option

  • Save Nathan-Nesbitt/fdf87d8d3bac4038e9f110642e7e4b9e to your computer and use it in GitHub Desktop.

Select an option

Save Nathan-Nesbitt/fdf87d8d3bac4038e9f110642e7e4b9e to your computer and use it in GitHub Desktop.
Example of Block Scoped Variables
// Create variable for only the outer block //
let i = 22;
// Create and loop over inner block variable //
for(let i = 0; i < 10; i++) {
console.log(i);
}
// Print outer block variable //
console.log(i);
@Nathan-Nesbitt
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment