Returns indexes of array items that pass a test
npm install @writetome51/array-get-indexes-that-passReturns indexes of items that pass the testFunction.
js
let arr = ['a', 'boy', 'is', 'playing', 'in', 'the', 'street'];getIndexesThatPass((value) => value.length > 3, arr);
// --> [3, 6]
getIndexesThatPass((value, i) => (value.length > 3) && (i > 3), arr);
// --> [6]
`Installation
npm i @writetome51/array-get-indexes-that-pass
Loading
`js
import {getIndexesThatPass} from '@writetome51/array-get-indexes-that-pass'
``