Skip to main content
Module

x/fae/find.ts>find

A functional module for Deno inspired from Ramda.
Latest
variable find
import { find } from "https://deno.land/x/fae@v1.1.1/find.ts";

Returns the first element of the list which matches the predicate, or undefined if no element matches.

Acts as a transducer if a transformer is passed in place of list

 const xs = [{a: 1}, {a: 2}, {a: 3}]
 Fae.find(Fae.propEq('a', 2))(xs) //=> {a: 2}
 Fae.find(Fae.propEq('a', 4))(xs) //=> undefined

type

Find