# Understand String Immutability SOS

**URL:** <https://forum.freecodecamp.org/t/understand-string-immutability-sos/144738>\
**Category:** General\
**Created:** [August 30, 2017, 7:28am UTC](https://forum.freecodecamp.org/t/understand-string-immutability-sos/144738 "2017-08-30T07:28:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rylew0925](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/rylew0925/32/66150_2.png) [@rylew0925](https://forum.freecodecamp.org/u/rylew0925)\
**Post date:** [August 30, 2017, 7:28am UTC](https://forum.freecodecamp.org/t/understand-string-immutability-sos/144738/1 "2017-08-30T07:28:39Z")

</div>

**Tell us what’s happening:**

Why is the code still marked wrong even though it was accepted? I do not understand the errors or if this was just a bug?

**Your code so far**

```auto
// Setup
var myStr = "Jello World";

// Only change code below this line

myStr ="Hello World";
myStr[0];

```

**Your browser information:**

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

**Link to the challenge:**  
[https://www.freecodecamp.org/challenges/understand-string-immutability](https://www.freecodecamp.org/challenges/understand-string-immutability)

---

<div class="post-metadata">

**Author:** ![pasDamola](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/pasdamola/32/64229_2.png) [@pasDamola](https://forum.freecodecamp.org/u/pasDamola)\
**Post date:** [August 30, 2017, 9:46am UTC](https://forum.freecodecamp.org/t/understand-string-immutability-sos/144738/2 "2017-08-30T09:46:44Z")

</div>

hello camper, you should remove this line “myStr[0];” and re-run the code. It should work perfectly.

---

<div class="post-metadata">

**Author:** ![TheGallery](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/thegallery/32/161197_2.png) [@TheGallery](https://forum.freecodecamp.org/u/TheGallery)\
**Post date:** [August 30, 2017, 10:07am UTC](https://forum.freecodecamp.org/t/understand-string-immutability-sos/144738/3 "2017-08-30T10:07:27Z")

</div>

Just throwing `myStr[0];` on a random line is invalid JS, it does nothing, that’s why you’re getting an error.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:41pm UTC](https://forum.freecodecamp.org/t/understand-string-immutability-sos/144738/4 "2021-01-17T20:41:01Z")

</div>


