Skip to main content
Module

x/rambda/source/findIndex.spec.js

Faster and smaller alternative to Ramda
Latest
File
import { findIndex } from './findIndex.js'import { propEq } from './propEq.js'
const list = [ { a : 1 }, { a : 2 }, { a : 3 } ]
test('happy', () => { expect(findIndex(propEq(2, 'a'), list)).toBe(1) expect(findIndex(propEq(1, 'a'))(list)).toBe(0) expect(findIndex(propEq(4, 'a'))(list)).toBe(-1)})