Neatly Packaged Magic

    @extra-array/count.min
    TypeScript icon, indicating that this package has built-in type declarations

    2.10.19 • Public • Published

    Counts values which satisfy a test. 📦 😺 🏃 📼 🌔 📜 📰 📘

    Alternatives: count, countAs.
    Similar: count, partition.

    This is part of package extra-array.

    This is browserified, minified version of @extra-array/count.
    It is exported as global variable array_count.
    CDN: unpkg, jsDelivr.


    array.count(x, ft);
    // x:  an array
    // ft: test function (v, i, x)
    const array = require("extra-array");
    
    var x = [1, 1, 2, 2, 4];
    array.count(x, v => v % 2 === 1);
    // 2
    
    array.count(x, v => v % 2 === 0);
    // 3


    References

    Install

    npm i @extra-array/count.min

    DownloadsWeekly Downloads

    0

    Version

    2.10.19

    License

    MIT

    Unpacked Size

    5.11 kB

    Total Files

    8

    Last publish

    Collaborators

    • wolfram77