Skip to main content
Module

x/rambda/lastIndexOf.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import { lastIndexOf } from './lastIndexOf'
test('happy', () => { const a = lastIndexOf(1, [ 1, 2, 3, 1, 2 ]) const b = lastIndexOf(1)([ 1, 2, 3, 1, 2 ])
expect(a).toEqual(3) expect(b).toEqual(3)})
test('false', () => { const a = lastIndexOf(10, [ 1, 2, 3, 1, 2 ])
expect(a).toEqual(-1)})