DEV Community

Discussion on: Daily Challenge #205 - Consonant String Value

Collapse
 
sabbin profile image
Sabin Pandelovitch

Very nice, I wasn't aware of the c.charCodeAt(0) - 96 rule, didn't work with chars very much in all these years to be honest.

Thread Thread
 
mellen profile image
Matt Ellen

It only works with lowercase a to z, because UTF-16 represents them as contiguous code points, starting at 97.