array-indexfor

0.1.2 • Public • Published

array-indexfor

NOTE: array-indexfor was renamed to @extra-array/index-of. NPM

Get first index of value in array, like Array.indexOf().

const indexFor = require('array-indexfor');
// indexFor(<array>, <search value>, [begin=0], [end])
 
indexFor(['b', 'u', 'n', 'u'], 'u');
// 1
indexFor(['b', 'u', 'n', 'u'], 'u', 2);
// 3
indexFor(['b', 'u', 'n', 'u'], 'u', 2, 3);
// -1

Readme

Keywords

Package Sidebar

Install

npm i array-indexfor

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

1.3 kB

Total Files

3

Last publish

Collaborators

  • wolfram77