UNPKG

moy-fp

Version:
19 lines (16 loc) 304 B
import curry from '../Function/curry' /** * (a -> Boolean) -> [a] -> Number */ const findIndex = curry( (pred, list) => { const entries = list.entries() for(let [index, item] of entries){ if(pred(item)){ return index } } return -1 } ) export default findIndex