LGTM On Wed, May 23, 2018 at 11:26 AM Mathias Bynens <[email protected]> wrote:
> Contact emails > [email protected], [email protected] > Spec > https://tc39.github.io/proposal-flatMap/ > Summary > A Stage 3 proposal introduces two new array methods. > Array.prototype.flat flattens arrays recursively up to the specified depth, which defaults to 1. > // Flatten one level: > const array = [1, [2, [3]]]; > array.flat(); > // → [1, 2, [3]] > // Flatten recursively until the array contains no more nested arrays: > array.flat(Infinity); > // → [1, 2, 3] > The same proposal includes Array.prototype.flatMap, which is like Array.prototype.map except it flattens the result into a new array. > [2, 3, 4].flatMap((x) => [x, x * 2]); > // → [2, 4, 3, 6, 4, 8] > Interoperability and compatibility risk > The flat method was originally called flatten, which was found to be not Web-compatible when Firefox shipped it. More recently, flatten was renamed into flat in the hopes of it resolving the compatibility issue. > Firefox: Public support (they shipped the proposal in its earlier form, and will now rename) > Edge: No public signals > Safari: Public support (Safari TP currently has a flatten implementation which they’ll rename) > Web developers: Strongly positive > Is this feature fully tested? > Yes; our implementation passes our own V8 tests as well as the Test262 tests for these two features. > Tracking bug > https://bugs.chromium.org/p/v8/issues/detail?id=7220 > Link to entry on the Chrome Platform Status dashboard > https://www.chromestatus.com/feature/6629507075145728 > Requesting approval to ship? > Yes. Note that since this is a V8/JS feature, this post is just an FYI to blink-dev — no signoff from Blink API owners is required. > -- > You received this message because you are subscribed to the Google Groups "blink-dev" group. > To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CADizRga6aY7zgR6x-8YuXCBYZGurPSzR9F4_%3DqK%2B7D_ADGY4-Q%40mail.gmail.com . -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
