ES6 Array#findIndex as a standalone module and a ponyfill (a polyfill that
doesn't overwrite the native method).
Finds an item in an array matching a predicate function, and returns its index.
Fast both when thisArg is used and also when it isn't:
npm install find-index
var findIndex = require('find-index/findIndex')
var findIndex = require('find-index/ponyfill') // will use native Array#findIndex if available.var findLastIndex = require('find-index/findLastIndex') // search backwards from end
findIndex(array, callback[, thisArg])
findLastIndex(array, callback[, thisArg])
The array to operate on.
Function to execute on each value in the array, taking three arguments:
The current element being processed in the array.
The index of the current element being processed in the array.
The array findIndex was called upon.
Object to use as this when executing callback.