Nitrate Processed Mincemeat

    @extra-iterable/find-indices
    TypeScript icon, indicating that this package has built-in type declarations

    2.4.0 • Public • Published

    Finds indices of values passing a test. 🏃 📼 📦 🌔 📒

    Alternatives: findIndex, findIndices.
    Similar: find, findIndex.
    This is part of package extra-iterable.

    iterable.findIndices(x, fn, [ths]);
    // x:   an iterable
    // fn:  test function (v, i, x)
    // ths: this argument
    const iterable = require('extra-iterable');
     
    var x = [1, 2, 3, 4, 5];
    [...iterable.findIndices(x, v => v % 2 == 0)];
    // [ 1, 3 ] ^     ^
     
    [...iterable.findIndices(x, v => v % 2 == 1)];
    // [ 0, 2, 4 ] ^     ^

    references

    Install

    npm i @extra-iterable/find-indices

    DownloadsWeekly Downloads

    151

    Version

    2.4.0

    License

    MIT

    Unpacked Size

    6.51 kB

    Total Files

    14

    Last publish

    Collaborators

    • wolfram77