Skip to main content
Module

x/rambda/lastIndexOf.js

Faster and smaller alternative to Ramda
Go to Latest
File
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}