Array.prototype.flatMap()
Last updated
Was this helpful?
Last updated
Was this helpful?
The flatMap()
method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level. It is identical to a followed by a of depth 1, but slightly more efficient than calling those two methods separately.
reduce() and concat()