Skip to content

Instantly share code, notes, and snippets.

@Damimd10
Last active March 24, 2019 19:07
Show Gist options
  • Save Damimd10/db36587bf2ffb6fae69513418a3bbdff to your computer and use it in GitHub Desktop.
Save Damimd10/db36587bf2ffb6fae69513418a3bbdff to your computer and use it in GitHub Desktop.
var canIVote = 'No';
function areYouOlderThan18() {
if (true) {
var canIVote = 'Yes';
}
console.log(canIVote); // log 'Yes', not the global value of 'No'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment