array-count-values
v1.0.0
Published
array-count-values return an object of values from an array as keys and their count as value.
Downloads
1
Maintainers
Readme
array-count-values
array-count-values return an object of values from an array as keys and their count as value.
Install
Install with npm:
npm i array-count-values
Usage
const arrayCountValues = require("array-count-values");
const arr = [1, "hello", 1, "world", "hello"];
arrayCountValues(arr); // => { '1': 2, hello: 2, world: 1 }
Author
Nabed Khan
License
Copyright (c) 2022 Released under the MIT license