@tempots/std

filterMapArray() function

Applies a mapping function to each element of an array and returns a new array containing the mapped values, excluding any null or undefined values.

Signature:

filterMapArray: (arr: A[], f: (a: A, index: number) => Maybe) => B[]

Parameters

Parameter

Type

Description

arr

A[]

The input array.

f

(a: A, index: number) => Maybe

The mapping function to apply to each element.

Returns: B[]

The new array containing the mapped values.