DEV Community

Discussion on: JavaScript Katas: Count the number of each character in a string

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Golfed. Can anyone go smaller? 😛

let c=t=>[...t].reduce((a,v)=>(a[v]=~~a[v]+1,a),{})
Collapse
 
miku86 profile image
miku86

Hey Jon,

we can remove the let 😜