Question 1 of 16
JavaScript Unicode-aware Strings Quiz
Check your understanding of UTF-16 code units, code points, surrogate pairs, well-formed strings, normalization, and text boundaries.
Knowledge check
JavaScript Unicode-aware Strings Quiz
Check your understanding of UTF-16 code units, code points, surrogate pairs, well-formed strings, normalization, and text boundaries.
- Stuck? Each question has an optional hint.
- Skip a hard question and review it before your results.
- Questions and answer options can shuffle between attempts.
You can retake this quiz whenever you like.
Question 2 of 16
What does `codePointAt(0)` do for a valid surrogate pair?
Question 3 of 16
Which operation is code-point-aware for String iteration?
Question 4 of 16
Which constructor creates a string from code point values?
Question 5 of 16
Why is `[...text].length` not a visible-character counter?
Question 6 of 16
What does `isWellFormed()` report?
Question 7 of 16
What does `toWellFormed()` do?
Question 8 of 16
When should `normalize()` be used?
Question 9 of 16
What can happen when slicing an emoji at a code-unit boundary?
Question 10 of 16
Which escape directly expresses U+1F600 as a code-point escape?
Question 11 of 16
Which case-conversion claim is safest?
Question 12 of 16
What coordinate system does `indexOf()` return?
Question 13 of 16
For a visible-text count, what concept matters?
Question 14 of 16
Which is an ECMAScript String fact?
Question 15 of 16
Why can a supplementary code point use two code units?
Question 16 of 16
Which iteration pattern avoids manual surrogate-pair handling?
Quiz results
Review
-
What does JavaScript String `length` count?Hint used
-
What does `codePointAt(0)` do for a valid surrogate pair?Hint used
-
Which operation is code-point-aware for String iteration?Hint used
-
Which constructor creates a string from code point values?Hint used
-
Why is `[...text].length` not a visible-character counter?Hint used
-
What does `isWellFormed()` report?Hint used
-
What does `toWellFormed()` do?Hint used
-
When should `normalize()` be used?Hint used
-
What can happen when slicing an emoji at a code-unit boundary?Hint used
-
Which escape directly expresses U+1F600 as a code-point escape?Hint used
-
Which case-conversion claim is safest?Hint used
-
What coordinate system does `indexOf()` return?Hint used
-
For a visible-text count, what concept matters?Hint used
-
Which is an ECMAScript String fact?Hint used
-
Why can a supplementary code point use two code units?Hint used
-
Which iteration pattern avoids manual surrogate-pair handling?Hint used