1You will be able to get the current iteration's index for the map method through its 2nd parameter.
2
3Example:
4
5const list = [ 'h', 'e', 'l', 'l', 'o'];
6list.map((currElement, index) => {
7 console.log("The current iteration is: " + index);
8 console.log("The current element is: " + currElement);
9 console.log("\n");
10 return currElement; //equivalent to list[index]
11});