Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

array-find-index

sindresorhus15mMIT1.0.2TypeScript support: definitely-typed

ES2015 Array#findIndex() ponyfill

es2015, ponyfill, polyfill, shim, find, index, findindex, array

readme

array-find-index Build Status

ES2015 Array#findIndex() ponyfill

Install

$ npm install --save array-find-index

Usage

const arrayFindIndex = require('array-find-index');

arrayFindIndex(['rainbow', 'unicorn', 'pony'], x => x === 'unicorn');
//=> 1

API

Same as Array#findIndex(), but with the input array as the first argument.

License

MIT © Sindre Sorhus