Skip to content

nabedkhan/array-count-values

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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

About

array-count-values return an object of values from an array as keys and their count as value.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published