Skip to content

Function.find

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

umt / find

Function: find()

find<T>(predicate): (array) => T | undefined

Defined in: Pipe/find.ts:10

Creates a pipe operator that returns the first array element matching a predicate

Type Parameters

T

T

Parameters

predicate

(value, index) => boolean

The condition the element must satisfy

Returns

An operator that returns the first match, or undefined

(array) => T | undefined

Example

pipe([1, 2, 3], find((x) => x > 1)); // 2
pipe([1, 2, 3], find((x) => x > 5)); // undefined

API

Classes

Interfaces

Type Aliases

Variables

Functions

Clone this wiki locally