But why include index and originalArray parameters when you don't use them?
For that matter, why not make this point-free?
const map = (f) => (xs) => xs .map ((x) => f(x))
(... and around in circles we go!)
That's true, they are superfluous - I left those other args there to make it clearer how the args are moving around.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.