Created
December 21, 2016 16:49
-
-
Save anonymous/801e24b2e0c52bf2aef2be07d681ef68 to your computer and use it in GitHub Desktop.
function declaration and function expression created by xgqfrms - https://repl.it/Euze/7
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
showState(); | |
// output: Ready | |
console.log("function declaration"); | |
function showState() { | |
console.log("Ready"); | |
} | |
console.log("function expression"); | |
var showState = function() { | |
console.log("Idle"); | |
}; | |
showState(); | |
/* | |
https://www.sitepoint.com/demystifying-javascript-variable-scope-hoisting/ | |
函数声明完全提升。 | |
这意味着整个函数的主体被移动到顶部。 | |
这允许您在声明之前调用函数: | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://repl.it/Euze/7