LearnFrenzy
Sign in Take a free test

Strings · JavaScript Strings MCQ · Question 1

Are strings mutable? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 1 Back to Exercise

After let s = "code"; s.toUpperCase();, what is s?

  • A "code" – strings are immutable, so the method returns a new string that was not stored Correct
  • B "CODE"
  • C "Code"
  • D undefined
Correct Answer: Option A

Every string method returns a new value. Write s = s.toUpperCase() to keep the result.

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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links