so, you need the callback, and you need the array, right?

If that’s all you need, your proposal is shorter without the method:

arr.replace(map);// VSmap(arr);

Once the |> (pipe) operator will be out, currently at Stage 1, you can:

arr |> map

so no need to pollute the Array prototype.

Web, Mobile, IoT, and all JS things since 00's. Formerly JS engineer at @nokia, @facebook, @twitter.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store