0.1.2 • Published 6 years ago

array-indexfor v0.1.2

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

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