@@ -608,21 +608,21 @@ the elements in the array.
608608
609609But how do we get the character codes in a string?
610610
611- In [ Chapter ?] ( values ) I mentioned that JavaScript ((string))s
612- are encoded as a sequence of 16-bit number called _ ((code unit))s_ . A
611+ In [ Chapter ?] ( values ) I mentioned that JavaScript ((string))s are
612+ encoded as a sequence of 16-bit numbers called _ ((code unit))s_ . A
613613((Unicode)) ((character)) code was initially supposed to fit within
614614such a unit (which gives you a little over 65 thousand characters).
615615When it became clear that that wasn't going to be enough, many people
616616balked at the need to use more memory per character. To address these
617617concerns, ((UTF-16)), the format used by JavaScript strings, was
618- invented. It describes some character using a single 16-bit code unit,
619- and others using a pair of two such units.
618+ invented. It describes some characters using a single 16-bit code
619+ unit, and others using a pair of two such units.
620620
621621{{index error}}
622622
623623UTF-16 is generally considered a bad idea now. It seems almost
624624intentionally designed to invite mistakes. It's easy to write programs
625- that pretends code units and characters are the same thing. And if
625+ that pretend code units and characters are the same thing. And if
626626your language doesn't use two-unit characters, that will appear to
627627work just fine. But as soon as someone tries to use such a program
628628with some less common ((Chinese characters)), it breaks. Fortunately,
0 commit comments