npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

@extra-iterable/find-index

1.1.1 • Public • Published

Get index of first value in iterable that satisfies the test, like Array.findIndex().

const findIndex = require('@extra-iterable/find-index');
// findIndex(<iterable>, <test function>, [this], [begin=0], [end])
// - <test function>(<value>, <index>, <iterable>)
 
findIndex(new Set(['A', 'B']), (v) => v>'A');
// 1
findIndex('abc', (v) => v>'b', null, 1);
// 2
findIndex('abc', (v) => v>'b', null, 1, 2);
// -1

extra-iterable

install

npm i @extra-iterable/find-index

Downloadsweekly downloads

2

version

1.1.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability