1

Similar to How can I access iteration index in Ramda.map except I'd like to have access to the array instead.

Array.prototype.map accepts (item, index, arr) => {}. How can I access arr in Ramda.map?

Thanks

feihcsim
  • 1,444
  • 2
  • 17
  • 33

1 Answers1

1

The linked question quotes the Ramda documentation for addIndex pointing out that it

Creates a new list iteration function from an existing one by adding two new parameters to its callback function: the current index, and the entire list.

So the entire list is already supplied to your function when you use addIndex.

Scott Sauyet
  • 49,207
  • 4
  • 49
  • 103