(Understand String Immutability)

Tell us what’s happening:
this code is not working well help me

Your code so far


// Setup
var myStr = "Jello World";
myStr[0] = "J";
// Only change code below this line
myStr = "Hello World";
myStr[0] = "H"; // Fix Me



Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/understand-string-immutability

Yo cant change any chars inside String, you just should put myString = “Hello World”;

// Setup
var myStr = "Jello World";

// Only change code below this line
myStr = "Hello World";

Also you have the explanation: “…just that the individual characters of a string literal cannot be changed. The only way to change myStr would be to assign it with a new string…”

1 Like

it is have a good help, let me understand. Thank you

already solve it, so I understand. Thank you. :slightly_smiling_face: