destructure in for loop

by ShaCP

JavaScript

var array = [1, 2, 3, 4, 5]

for (const [item, i] of array.entries()) {
console.log(item, i);
}