array-count

Count occurences of value in array.

Usage no npm install needed!

<script type="module">
  import arrayCount from 'https://cdn.skypack.dev/array-count';
</script>

README

array-count

NOTE: array-count was renamed to @extra-array/count. NPM

Count occurences of value in array.

const count = require('array-count');
// count(<array>, <value>, [begin=0], [end])
// -> <count of value>

count(['e', 'e', 'r', 'i', 'e'], 'e');
// 3
count(['e', 'e', 'r', 'i', 'e'], 'e', 1);
// 2
count(['e', 'e', 'r', 'i', 'e'], 'e', 1, 4);
// 1