Skip to content

Instantly share code, notes, and snippets.

@DenisCangemi
Created June 30, 2019 18:24
Show Gist options
  • Save DenisCangemi/d7f4cb58c4eb074838ae092a0feb4277 to your computer and use it in GitHub Desktop.
Save DenisCangemi/d7f4cb58c4eb074838ae092a0feb4277 to your computer and use it in GitHub Desktop.
Example of var keyword visibility part 2
...
function set() {
var x = 50;
var y = 30;
}
// Call the set() function
set();
// Write the values in the console
console.log(x); // Result : 20
console.log(y); // Result : Error not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment