Characters, Bytes, and Code Points: Why String Length Is Never Simple
Pop quiz. What does "hello".length return in JavaScript? Five, obviously. Now what does "cafe\u0301".length return? If you said 5, you're right. The string looks like "cafe" with an accent on the e, rendering as "caf\u00e9." But it's 5 characters, no...
zovo.hashnode.dev5 min read