Skip to content

Commit cf2776d

Browse files
committed
Fix a few typos in Chapter 5
1 parent 668d276 commit cf2776d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

05_higher_order.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,21 +608,21 @@ the elements in the array.
608608

609609
But 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
614614
such a unit (which gives you a little over 65 thousand characters).
615615
When it became clear that that wasn't going to be enough, many people
616616
balked at the need to use more memory per character. To address these
617617
concerns, ((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

623623
UTF-16 is generally considered a bad idea now. It seems almost
624624
intentionally 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
626626
your language doesn't use two-unit characters, that will appear to
627627
work just fine. But as soon as someone tries to use such a program
628628
with some less common ((Chinese characters)), it breaks. Fortunately,

0 commit comments

Comments
 (0)