Created
June 30, 2019 18:24
-
-
Save DenisCangemi/d7f4cb58c4eb074838ae092a0feb4277 to your computer and use it in GitHub Desktop.
Example of var keyword visibility part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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