How to get the index in a for...of loop #index #Typescript #Javascript
https://stackoverflow.com/questions/36108110/typescript-for-of-with-index-key
for (const {item, index} of someArray.map((item, index) => ({ item, index }))) {
console.log(item); // 9, 2, 5
console.log(index); // 0, 1, 2
}