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
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
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
.