UNPKG
quxt
Version:
latest (1.1.1)
1.1.1
1.1.0
1.0.0
Lodash but OVERPOWERED!
github.com/quxapp/quxt
quxapp/quxt
quxt
/
.internal
/
frequency.js
14 lines
(13 loc)
•
252 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function frequency(
data
) {
const
chart = new Map()
for
(item of
data
) {
const
value = chart.
get
(item)
if
(value) { chart.
set
(item, value +
1
) }
else
{ chart.
set
(item,
1
) } }
return
chart } module.exports = frequency