Open goldEli opened 4 years ago
输出结果: undefined Uncaught ReferenceError
所以先输出 undefined 再报错
输出:
分析:
function sayHi() {
var name;
console.log(name); // undefined
console.log(age); // Uncaught ReferenceError:age is not defined
name = "Lydia";
let age = 21;
}
sayHi();