I want to know the index number of an item of a for loop jave script code example
Example: javascript enumerate with index
const iterable = [...];
for (const [index, elem] in iterable.entries()) {
f(index, elem);
}
// or
iterable.forEach((elem, index) => {
f(index, elem);
});