来源:https://developer.mozilla.org/el/docs/Web/JavaScript/Reference/Operators/function
“与函数声明不同,JavaScript中的函数表达式不会被提升,在声明它们之前,不能使用函数表达式。
函数表达式提升?
例子:
var hey = function(){
console.log("hi");
}
Chrome的控制台:window.hey返回
function(){
console.log("hi");
}
这里有问题吗? – RobG
我在这里没有看到任何问题,请说清楚你想知道什么。 – cyrix
什么问题?你在**声明函数后使用'window.hey' **,所以你引用的文档不适用。 – Barmar