Created
March 27, 2015 00:18
-
-
Save cgrinaldi/929915b6ba656b4f2ea2 to your computer and use it in GitHub Desktop.
A simple example of hoisting with function expressions
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
var myNumber = 2; | |
console.log(myNumber); |
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
var myNumber; // this has been hoisted! | |
myNumber = 2; | |
console.log(myNumber); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment