UNPKG

rambdax

Version:

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

16 lines (11 loc) 286 B
import { equals } from './equals' export function lastIndexOf(target, list){ if (arguments.length === 1) return _list => lastIndexOf(target, _list) let index = list.length while (--index > 0){ if (equals(list[ index ], target)){ return index } } return -1 }