Web platform features explorer

Array flat() and flatMap()

Widely available since 2022-07-15
Tags: javascript Groups: JavaScript > Collections > Arrays

The flat() and flatMap() methods for arrays creates a new array such that each nested array item is concatenated into it.

Browser support (view on caniuse.com)

  • Chrome 69 Released on 2018-09-04
  • Chrome Android 69 Released on 2018-09-04
  • Edge 79 Released on 2020-01-15
  • Firefox 62 Released on 2018-09-05
  • Firefox for Android 62 Released on 2018-09-05
  • Safari 12 Released on 2018-09-17
  • Safari on iOS 12 Released on 2018-09-17