-
-
Save danielimmke/27df25c5a77b85dccd745db380edec15 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
console.log(hoistedVar); // "undefined" - hoisted declaration only | |
console.log(nonHoistedConst); // Throws an actual error in JS: nonHoistedConst is not defined | |
var hoistedVar = "Hoisted"; | |
const nonHoistedConst = "Definitely not hoisted"; | |
console.log(hoistedVar); // Actually displays the value of the variable. | |
console.log(nonHoistedConst); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment