SyntaxFix
Write A Post
Hire A Developer
Questions
How about this
let numbers = [1,2,3,4,5] numbers.forEach((number, index) => console.log(`${index}:${number}`))
Where array.forEach this method has an index parameter which is the index of the current element being processed in the array.
array.forEach
index