以下代码在 `chrome` 输出 `1,2,3` const arr = [1,2,3] arr.forEach(i=>{ arr.push(i) console.log(i) }) 这个在网上找到了,`forEach` 一开始就已经获取了 数组长度 > The range of elements processed by forEach is set before the first call to > callbackfn. Elements which are appended to the array after the call to > forEach begins will not be visited by callbackfn. 但是怎么解释以下代码 只输出了 `1`? const arr = [1,2,3] arr.forEach(i=>{ if(i===1) arr.length = 0 console.log(i) }) 网上都查过了, 找不到 期望有大佬 能贴出源码