Мне не хватает опции, чтобы получить номер индекса внутри функции map
, используя List
из Immutable.js
:
var list2 = list1.map(mapper => { a: mapper.a, b: mapper.index??? }).toList();
Документация показывает, что map()
возвращает Iterable<number, M>
. Есть ли какой-либо элегантный способ для того, что мне нужно?