@tempots/std

flatMapArray() function

Applies a mapping function to each element of an array and flattens the result.

Signature:

flatMapArray: (arr: A[], f: (a: A) => B[]) => B[]

Parameters

Parameter

Type

Description

arr

A[]

The input array.

f

(a: A) => B[]

The mapping function to apply to each element of the array.

Returns: B[]

A new array with the flattened result of applying the mapping function to each element of the input array.