我正在使用代码块来模拟 la C 中的静态函数变量。这是基本设置:
{
let bob = 5;
function b() {
console.log(bob++);
}
}
现在在 chrome 中,这个编译很好,没有任何抱怨。然而,在 Safari 中,我得到一个
SyntaxError: Unexpected identifier 'bob'. Expected a ':' following the property name 'let'.
我不知道是什么导致了这种差异,因为 Chrome 和 Safari 都处理 ECMAScript 6。
慕勒3428872
眼眸繁星
相关分类