1.0.0 • Published 2 years ago

array-count-values v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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