Package: effect
Module: Array
Flattens a nested array of arrays into a single array.
When to use
Use to collapse one level of nested arrays when no per-element mapping is needed.
Example (Flattening nested arrays)
import { Array } from "effect"
console.log(Array.flatten([[1, 2], [], [3, 4], [], [5, 6]])) // [1, 2, 3, 4, 5, 6]
See
flatMap — map then flatten in one stepSignature
declare const flatten: <const S extends ReadonlyArray<ReadonlyArray<any>>>(self: S) => ReadonlyArray.Flatten<S>
Since v2.0.0