函数声明:在所有函数表达式之前先解析,如下:
function test(){
console.log("函数声明")
}
函数表达式:在用到时解析,如下:
var test = function(){
console.log("函数表达式");
return "test";
}
函数声明:在所有函数表达式之前先解析,如下:
function test(){
console.log("函数声明")
}
函数表达式:在用到时解析,如下:
var test = function(){
console.log("函数表达式");
return "test";
}