I guess the thing I'm harping on is shawnz saying that javascript is INHERENTLY functional. I think it's possible to write javascript in a functional way: Underscore.js is a perfect example of that. But I wouldn't say it's INHERENT of javascript.
I think javascript is INHERENTLY object oriented/imperative but can be functional if you put some effort into it.
Well, at least one mutating index is convenient:
After that, you generally wouldn't need more indexes.But does it really require a mutating index?
Array copies aren't particularly efficient, of course, and there are languages with data structures backing arrays for which some similar approach might be efficient, but there it is.