DEV Community

Discussion on: Getting the frequency of an element in an array in JavaScript

Collapse
 
mzaini30 profile image
Zen

You can change Number(e) with +e

Collapse
 
keogami profile image
keogami

Thats too hacky and non intuitive i.e. not readable. As a simple rule you must avoid being clever because readable code is always better than clever code 😊

Collapse
 
perelynsama profile image
Perelyn-sama

True, simple code is good code.

Collapse
 
perelynsama profile image
Perelyn-sama

Thanks for the pointer.