Index inside map() function

I am missing a option how to get the index number inside the map function using List from Immutable.js:

var list2 = list1.map(mapper => { a: mapper.a, b: mapper.index??? }).toList();

Documentation shows that map() returns Iterable<number, M>. Is there any elegant way to what I need?

4 Answers
4

Leave a Comment