News for hackers. Stuff that matters.
Re:Don't let TC39 use smoosh or smooshMap by WorldMaker on Friday March 09, 2018 @03:36PM (#16554781)
Technical Committee 39 of ECMA [1] is the governing board for the living ECMAScript standards documents, which influence the direction of the language we more often call JavaScript.

There's a current TC39 proposal [2] (at Stage 3, which is the discovery stage to gauge feasibility in browsers) to add officially to the language standard `Array.prototype.flatten()` (to flatten an array like `[[1, 2], 3, [4, 5]]` to `[1, 2, 3, 4, 5]`) and `Array.prototype.flatMap` (to `flatten().map()` as a single operation).

Because browser vendors discovered some libraries in the wild (8+ year old versions of MooTools) install their own incompatible to the new spec version of `Array.prototype.flatten` that does something different from the array flattening above, there is a discussion (as PR) [3] to avoid breaking ancient websites by choosing a new name for the proposed `Array.prototype.flatten`, in the case of the PR `Array.prototype.smoosh`. (For consistency it then renames `Array.prototype.flatMap` to `Array.prototype.smooshMap`.)

Other names are being discussed as well in the PR, and the TC39 committee has not yet actually met on the subject at this time, so nothing is quite set in stone.

[1] https://github.com/tc39 [2] https://tc39.github.io/proposal-flatMap/ [3] https://github.com/tc39/proposal-flatMap/pull/56

There are no comments on this comment yet.