albertodemichelis / squirrel

Official repository for the programming language Squirrel
http://www.squirrel-lang.org
MIT License
913 stars 156 forks source link

Allow additional parameters in array.map()/array.apply() handler #168

Closed VasiliyRyabtsev closed 5 years ago

VasiliyRyabtsev commented 5 years ago

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)