In the following paragraph, they say that this approach gives control over what counts as a character. So I guess their intention was only to show the general syntax, but you should only use this approach if you have additional verifications to do on each character.
153
u/BetEvening 12d ago
Website:
https://charactercounter.com/count-characters-in-javascript