UNPKG

rambdax

Version:

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

14 lines (10 loc) 236 B
export function findLastIndex(fn, list){ if (arguments.length === 1) return _list => findLastIndex(fn, _list) let index = list.length while (--index >= 0){ if (fn(list[ index ])){ return index } } return -1 }