@extra-array/count.min

Counts values which satisfy a test.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@extra-array/count.min
1402.10.197 months ago3 years agoMinified + gzip package size for @extra-array/count.min in KB

Readme

Counts values which satisfy a test. :package: :smileycat: :running: :vhs: :moon: :scroll: :newspaper: :bluebook:
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 arraycount.
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