🏠 New in High Baseline Support: Array flat() and flatMap()
July 15, 2022
caniuse · mdn · [spec]([‘https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.flat’, ‘https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.flatmap’])
The flat()
and flatMap()
methods for arrays creates a new array such that each nested array item is concatenated into it.