Skip to main content
Module

x/rambda/source/find.js

Faster and smaller alternative to Ramda
Go to Latest
File
export function find(predicate, list) { if (arguments.length === 1) return _list => find(predicate, _list)
let index = 0 const len = list.length
while (index < len) { const x = list[index] if (predicate(x)) { return x }
index++ }}