I don't like the fact the only way to sort is in-place with Array#sort and I can't be the first to feel this way or wonder why there isn't a built-in solution.
Obviously, searching "javascript array.sort" doesn't produce any helpful results to see if someone has suggested this before since all the results relate to Array#sort. I'm considering creating a proposal to add an Array.sort() method that takes an array and returns a new array. It seems like such a simple addition that would remove the need to import lodash, write a helper function or use a slightly less clear and possibly slower technique like `[...arr].sort()`.
signature.asc
Description: Message signed with OpenPGP
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

