// Setup
var myStr = "Jello World";
// Only change code below this line
myStr[0] = "H"; // Fix Me
to do this it has me add
myStr = "Hello World";
why would i do this and not just change the J to an H in this first place seems like i am doing extra work when i can just go back in and change one letter.
Well, because you can’t change it in place, because the string is immutable. So changing just the first letter becomes some extra work in itself (some slicing and dicing is required, creating new, shorter strings and then gluing them back together), and that’s probably why the simple replacement of complete string was used for this example.
But I think you can do it any way you want, as long as the final value of myStr is “Hello World”.
Mhm, as the description of the challenge says, strings are immutable even if they’re iterable like arrays. But strings being iterable can be good because it means you can do this.