Skip to content

find index

Subhajit Sahu edited this page May 5, 2020 · 1 revision

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

const findIndex = require('@extra-string/find-index');
// findIndex(<string>, <testFn>, [thisArg])

findIndex('badd0g', (v) => v>'f');
// 5
findIndex('badcab', (v) => v>'f');
// -1
findIndex('', (v) => v>'f');
// -1

extra-string

Clone this wiki locally