for of loop - get index

PHOTO EMBED

Sun Mar 19 2023 07:42:05 GMT+0000 (Coordinated Universal Time)

Saved by @davidmchale #loop #index

const deck = ['clubs','spades', 'hearts', 'diamonds']
for(let [index, item] of deck.entries()){
    console.log(index)
}
content_copyCOPY