var tmp = new Date();
function f(){
console.log(tmp);
if(false){
var tmp = "hello world";
}
}
输出结果为 undefined,原因:js的生命提升。
console.log(1<2<3)
输出结果为 true
console.log)(1>2>3)
输出结果为 false
var tmp = new Date();
function f(){
console.log(tmp);
if(false){
var tmp = "hello world";
}
}
输出结果为 undefined,原因:js的生命提升。
console.log(1<2<3)
输出结果为 true
console.log)(1>2>3)
输出结果为 false