jack e1a2621c78 update | 2 years ago | |
---|---|---|
.. | ||
index.js | 2 years ago | |
license | 2 years ago | |
package.json | 2 years ago | |
readme.md | 2 years ago |
ES2015
Array#findIndex()
ponyfill
$ npm install --save array-find-index
const arrayFindIndex = require('array-find-index');
arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn');
//=> 1
Same as Array#findIndex()
, but with the input array as the first argument.
MIT © Sindre Sorhus