Last active
February 21, 2020 23:08
-
-
Save jasminegmp/0713a7a96afebb8d9fd3dd0831f90419 to your computer and use it in GitHub Desktop.
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 myFunction(){ | |
let a; // a's declaration is hoisted here, but remains uninitialized | |
a; // Will get a ReferenceError: Cannot access 'a' before initialization | |
console.log(a); | |
a = 'hello'; // everything above this line of code is referenced as temporal dead zone | |
} | |
myFunction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment