entries

let arr = [1,2,3,4,5,6,7];
for (let [index, leaflet] of arr.entries()){
    console.log(index,leaflet)
}

 

posted @ 2021-02-04 11:55  LaLaLa_heng  阅读(771)  评论(0编辑  收藏  举报