Array.prototype.{flat,flatMap} S4
Proposal details
- Stage: Stage 4
- Status: Finished
- ECMAScript edition: ES2019
- Synchronized: Aug 28, 2026
- 中文译文 · Source repository
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.