@extra-array/count-all-on.min

2.4.37 • Public • Published

Counts occurrences of values.

Alternatives: one, one-map, all-map.
This is part of package extra-array.

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

array.countAllOn(x, [fn], [ths]);
// x:   an array
// fn:  map function (v, i, x)
// ths: this argument
// --> occurrences
const array = require('extra-array');

var x = [1, 1, 2, 2, 4];
array.countOn(x, 2);
// 2           ^  ^

var x = [1, 1, 2, 2, 4];
array.countOn(x, 3, v => v % 2);
// 2     ^  ^

references

/@extra-array/count-all-on.min/

    Package Sidebar

    Install

    npm i @extra-array/count-all-on.min

    Weekly Downloads

    74

    Version

    2.4.37

    License

    MIT

    Unpacked Size

    4.59 kB

    Total Files

    4

    Last publish

    Collaborators

    • wolfram77