@tempots/std

filterArray() function

Filters the elements of an array based on a predicate function.

Signature:

filterArray: (arr: T[], predicate: (v: T) => boolean) => T[]

Parameters

Parameter

Type

Description

arr

T[]

The array to filter.

predicate

(v: T) => boolean

The predicate function used to filter the elements.

Returns: T[]

The filtered array.