array-counter

Counts unique elements of an array

Usage no npm install needed!

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

README

NPM version"> Build Status

counts unique elements of an array

Install

$ npm install --save array-counter

Usage

var arrayCounter = require('array-counter');
var arr = ["foo", "bar", 10, 40, "foo", 10, "Hello World"];
arrayCounter(arr);
//> {
//    '10': 2,
//    '40': 1,
//    foo: 2,
//    bar: 1,
//    'Hello World': 1
// }

License

MIT © Mert Kahyaoğlu