Skip to main content
Module

x/lazy/lib/lazy.ts>Lazy#first

A linq-like lazy-evaluation enumerable/iteration library that aims to support deno, node & browser
Latest
method Lazy.prototype.first
import { Lazy } from "https://deno.land/x/lazy@v1.7.3/lib/lazy.ts";

Returns the first element in the iterable.

Returns

TElement

The first element in the iterable.

Returns the first element that satisfies the given condition.

Parameters

predicate: BoolPredicate<TElement>

The predicate to test each element with.

Returns

TElement

The first element in the iterable that satisfies the condition.