This guide omits an IMPORTANT issue: handling characters outside the Basic Multilingual Plane (BMP). JavaScript, like some other languages, suffers from the UCS-2 curse - that is, it assumes that all characters fit inside 16 bits, even though that is no longer true.<p>For example, the cited text says: "You can return the UTF-16 code for a character in a string using charCodeAt()...".<p>Not true. This only works if the UTF-16 code fits in 16 bits; if it's more than 16 bits, charCodeAt will only return a <i>part</i> of the character.<p>There are lots of discussions about this, here's one:
<a href="https://stackoverflow.com/questions/3744721/javascript-strings-outside-of-the-bmp" rel="nofollow">https://stackoverflow.com/questions/3744721/javascript-strin...</a><p>JavaScript <i>can</i> handle characters outside the BMP, but you sometimes have to aware of the problem & carefully code around it when such characters are possible.