UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

16 lines (12 loc) 266 B
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++ } }