We can access array elements using a for-of loop:(我们可以使用for-of循环访问数组元素:)
for (const j of [1, 2, 3, 4, 5]) {
console.log(j);
}
How can I modify this code to access the current index too?(如何修改此代码也可以访问当前索引?) I want to achieve this using for-of syntax, neither forEach nor for-in.(我想使用for-of语法来实现此目的,无论是forEach还是for-in。)
ask by Abdennour TOUMI translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…