@extra-array/count-all
v1.1.7
Published
Count occurences of all values in array.
Downloads
80
Maintainers
Readme
Count occurences of all values in array.
const countAll = require('@extra-array/count-all');
// countAll(<array>, [begin=0], [end], [target=new Map()])
// -> <target>
countAll(['e', 'e', 'r', 'i', 'e']);
// Map {'e' => 3, 'r' => 1, 'i' => 1}
countAll(['e', 'e', 'r', 'i', 'e'], 1);
// Map {'e' => 2, 'r' => 1, 'i' => 1}
countAll(['e', 'e', 'r', 'i', 'e'], 1, 4);
// Map {'e' => 1, 'r' => 1, 'i' => 1}
With extra-array try
Array.countAll()
instead.