Issue 1:
In the section "String Iterators" the following sentence might be wrong (please notice the bold text):
But bracket notation works on code units rather than characters, so it cannot be used to access double-byte characters correctly
Reason:
characters in JavaScript are already double byte sized (UTF-16), so bracket notation works normally for them.
I believe the text should refer to surrogate pairs or double sized characters as the ones having issues.
Possible Solution
But bracket notation works on code units rather than characters, so it cannot be used to access surrogate pairs correctly
Issue 2:
The following section may also have an error:
This outputs the following:
A
(blank)
𠮷
(blank)
B
This result is more in line with what you'd expect when working with characters: the loop successfully prints the Unicode character, as well as all the rest.
Reason:
All the characters are Unicode characters.
Solution
Switch the term Unicode character with something like surrogate pair / astral symbol/ astral code point / double sized character
Issue 1: In the section "String Iterators" the following sentence might be wrong (please notice the bold text):
Reason: characters in JavaScript are already double byte sized (UTF-16), so bracket notation works normally for them. I believe the text should refer to surrogate pairs or double sized characters as the ones having issues.
Possible Solution
Issue 2: The following section may also have an error:
Reason: All the characters are Unicode characters.
Solution Switch the term Unicode character with something like
surrogate pair
/astral symbol
/astral code point
/double sized character