为什么以下无效的JavaScript?
if (var foo = (true || false)) {
console.log(foo);
}
在这里看看:
http://www.ecma-international.org/ecma-262/5.1/#sec-12.5
然后在这里:
http://www.ecma-international.org/ecma-262/5.1/#sec-11
并得出以下结论,该语法无效:
http://www.ecma-international.org/ecma-262/5.1/#sec-12.2
相对于(或缺乏)上述内容。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句