Created
January 31, 2025 21:31
-
-
Save jlcarrascof/351520e757ca51f66ffbeacfeb4d285d to your computer and use it in GitHub Desktop.
Hoisting Example.
This file contains hidden or 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
console.log(a); // What value does 'a' have here? | |
var a = 5; | |
console.log(b); // What value does 'b' have here? | |
let b = 10; | |
function example() { | |
console.log(c); // What value does 'c' have here? | |
var c = 15; | |
console.log(d); // What value does 'd' have here? | |
let d = 20; | |
if (true) { | |
console.log(e); // What value does 'e' have here? | |
var e = 25; | |
console.log(f); // What value does 'f' have here? | |
let f = 30; | |
} | |
console.log(e); // What value does 'e' have here? | |
console.log(f); // What value does 'f' have here? | |
} | |
example(); | |
console.log(a); // What value does 'a' have here? | |
console.log(b); // What value does 'b' have here? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment