UNPKG

rambda

Version:

Lightweight and faster alternative to Ramda with included TS definitions

15 lines (12 loc) 226 B
export function findIndex(predicate) { return list => { const len = list.length let index = -1 while (++index < len) { if (predicate(list[index])) { return index } } return -1 } }