For AI agents: the complete documentation index is available at /tc39-atlas/en/llms.txt, the full documentation bundle is available at /tc39-atlas/en/llms-full.txt, and this page is available as Markdown at /tc39-atlas/en/proposals/stage/4/proposal-flatMap.md.
  • English
  • Array.prototype.{flat,flatMap} S4

    Proposal details
    Proposal overview

    This proposal aims to add two array methods to ECMAScript: flat(), which flattens nested arrays, and flatMap(), which maps elements and flattens the result by one level.

    Note

    The README below comes from the upstream repository and may contain outdated stage or status metadata. Use the proposal details above as the current source of truth.

    Array.prototype.{flat,flatMap}

    A proposal to add Array.prototype.flat (formerly known as Array.prototype.flatten) and Array.prototype.flatMap to ECMAScript.

    Status

    This proposal is at stage 4 of the TC39 Process.