Question 19
Back to Exercise
What does the following JavaScript code print (console output, as in Node.js)?
const word = "straße"; // "straße"
console.log(word.toUpperCase(), word.length, word.toUpperCase().length);
- A STRAßE 6 6
- B STRASSE 6 7 Correct
- C STRASSE 6 6
- D STRAẞE 6 6
Correct Answer: Option B
Case conversion follows Unicode rules: the German ß has no single upper-case letter in the default mapping and becomes "SS", so the length grows.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!