Skip to content

Function.filter

github-actions[bot] edited this page Nov 18, 2026 · 4 revisions

umt / filter

Function: filter()

filter<T>(predicate): (array) => T[]

Defined in: Pipe/filter.ts:9

Creates a pipe operator that keeps the array elements matching a predicate

Type Parameters

T

T

Parameters

predicate

(value, index) => boolean

The condition each element must satisfy

Returns

An operator that returns the matching elements

(array) => T[]

Example

pipe([1, 2, 3, 4], filter((x) => x % 2 === 0)); // [2, 4]

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally