immutable-array.findIndexFrom returns the index of the first item that matches with a predicate starting from some index. If any item doesn't match, then returns -1.
$ npm install immutable-array.findIndexFrom --saveconst ImmutableArray = {
of: require('immutable-array.of'),
findIndexFrom: require('immutable-array.findIndexFrom')
}
const array = ImmutableArray.of([5, 2, 3, 4, 5]) // {array: [1, 2, 3, 4, 5], length: 5}
ImmutableArray.findIndexFrom(0, e => e === 5, array) // 0
ImmutableArray.findIndexFrom(1, e => e === 5, array) // 4- Node.js >=6
- ES2015 transpilers
MIT