Frequency returns an object mapping each unique item in an array to the number of items it occurs in the array.
array
(Array): input array
(Object): object of uniq values and their frequency of occurrence
const result = arrays.frequency(['a', 'b', 'a', 'c', 'a', 'c', 'b']);
console.log(result)
> { a: 3, b: 2, c: 2 }