String
values are immutable, which means that they cannot be altered once created.
For example, the following code:
```js
var myStr = "Bob";
myStr[0] = "J";
```
cannot change the value of myStr
to "Job", because the contents of myStr
cannot be altered. Note that this does not mean that myStr
cannot be changed, 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, like this:
```js
var myStr = "Bob";
myStr = "Job";
```
myStr
so it contains the string value of Hello World
using the approach shown in the example above.
myStr
should have a value of Hello World
.
testString: assert(myStr === "Hello World");
- text: You should not change the code above the specified comment.
testString: assert(/myStr = "Jello World"/.test(code));
```