Sometimes it is needed to process array when result depends not on item value only, but also from its position or collection content.
So make array.map() and array.apply() functions more flexible by supporting optional additional parameters in callback: item index and reference to array being processed.
(The design is like in https://underscorejs.org/#map)
Sometimes it is needed to process array when result depends not on item value only, but also from its position or collection content. So make array.map() and array.apply() functions more flexible by supporting optional additional parameters in callback: item index and reference to array being processed. (The design is like in https://underscorejs.org/#map)