标签:back uncaught ack 作用 UNC 报错 必须 fun 输出
if (true) let x = 1; // 报错
if (true) {
let x = 1;
}
if (true) var x = 1; // 正常
if (true) { var x = 1; }
function f() { console.log(‘xx‘); }
(function () {
function f() { console.log(‘xx‘);
}
if (false) {}
f();
}());
//es5 输出 xx
// ES6
function f() { console.log(‘xx‘); }
(function () {
if (false) {
function f() { console.log(‘xx‘); }
}
f();
}());
// Uncaught TypeError: f is not a function
标签:back uncaught ack 作用 UNC 报错 必须 fun 输出
原文地址:https://www.cnblogs.com/blogZhao/p/12512599.html