Skip to content

flatMap

flatMap<A, B>(f): (data) => readonly B[]

Defined in: Core/Arr.ts:321

Maps each element to an array and flattens the result.

A

B

(a) => readonly B[]

(data): readonly B[]

readonly A[]

readonly B[]

pipe([1, 2, 3], Arr.flatMap(n => [n, n * 10])); // [1, 10, 2, 20, 3, 30]