Last updated 4 years ago
Was this helpful?
iterate all characters and count it
// Character Frequency // https://www.codewars.com/kata/548ef5b7f33a646ea50000b2/ const charFreq = (message) => [...message].reduce((acc, cur) => { acc[cur] = (acc[cur] || 0) + 1; return acc; }, {});