TypeScriptArrayflat

Creates a new array with all sub-array elements concatenated recursively up to the specified depth.

Syntax

array.flat(depth?): T[]