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

@extra-array/count-all-on

An array is a collection of values, stored contiguously.

by nodef

2.4.37 (see all)License:MITTypeScript:Not Found
npm i @extra-array/count-all-on
Readme

Counts occurrences of values.

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

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

Downloads/wk

5

GitHub Stars

14

LAST COMMIT

4mos ago

MAINTAINERS

1

CONTRIBUTORS

3

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
2.4.37
latest
2yrs ago
No alternatives found
No tutorials found
Add a tutorial