UNPKG

moy-fp

Version:
20 lines (17 loc) 343 B
import curry from '../Function/curry' import equals from '../Relation/equals' /** * a -> [a] -> Number */ const indexOf = curry( (predItem, list) => { const entries = list.entries() for(let [index, item] of entries){ if(equals(predItem, item)){ return index } } return -1 } ) export default indexOf