Skip to main content

Array.prototype.flat & Array.prototype.flatMap

Less than 1 minutefeaturees-proposalmissing-example

Array.prototype.flat & Array.prototype.flatMapopen in new window

Types

interface Array<T> {
  flat(depthArg: number): Array<T>;
  flatMap<U>(
    mapFn: (value: T, index: number, target: Array<T>) => U | Array<U>,
    thisArg: any
  ): Array<U>;
}

Entry points

core-js/proposals/array-flat-map