function Test(){
}
new Test()
['width', 'height'].forEach(key => {
console.log(key);
});
给了我错误
但是这个代码不
function Test(){
}
new Test()
var arr = ['width', 'height'];
arr.forEach(key => {
console.log(key);
});
为什么?
我使用铬 版本53.0.2785.116(64位) - 的MacBook Air 2014
我只是试图在Chrome 58的第一个例子;无法重现。你正在使用哪种浏览器? – Aurora0001
此代码应该正常工作,我只是尝试在Chrome 58上,它的工作 – quirimmo
请参阅[浏览器兼容性](http://www.caniuse.com/#search=foreach)for'aray.forEach' – Rajesh