const arr=[1,2,3];
for(const key of arr.keys()){ //可以遍历所有的索引
console.log(key)
}
10.在for...of 中取得数组的索引
最新推荐文章于 2024-07-10 15:45:24 发布
const arr=[1,2,3];
for(const key of arr.keys()){ //可以遍历所有的索引
console.log(key)
}