get index in a for of javascript code example Example: javascript for...of index for (const [i, v] of ['a', 'b', 'c'].entries()) { console.log(i, v) }