Created
September 8, 2016 18:55
-
-
Save JoeKarlsson/4433fcdd2914a4a56111087be44ed85f to your computer and use it in GitHub Desktop.
Hoisting live coding demo
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 tres(){ | |
var foo = 4 | |
return 3; | |
} | |
var uno; | |
var dos; | |
const quatro; | |
uno = 1; | |
console.log('dos: ', dos); | |
dos = 2; | |
console.log('tres: ', tres); | |
console.log('quatro(): ', quatro()); | |
quatro = function() { | |
return 4; | |
} |
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
//declaration | |
var uno = 1; | |
console.log('dos: ', dos); | |
var dos = 2; | |
console.log('tres: ', tres()); | |
// USE THIS FUNCTION DECLARATION | |
function tres(){ | |
var foo = 4 | |
return 3; | |
} | |
console.log('quatro(): ', quatro()); | |
const quatro = function() { | |
return 4; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment