Created
November 14, 2017 15:00
-
-
Save me-shaon/30564da1479eade2355651c4f604c7ab to your computer and use it in GitHub Desktop.
Javascript Hoisting caveat example for medium article
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 hoist() { | |
console.log(a); //this will show 'undefined' | |
var a = 10; | |
} | |
hoist(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment