Strings are immutable. You can't change a string after creating it. Methods that seem to modify strings return new strings:
let original = "hello"
let upper = original.toUpperCase()
console.log(original) // "hello" (unchanged)
console.log(upper) // "HELLO" (new string)
To "change" a string, you assign a new value to the variable:
let text = "hello"
text = text + " world" // text now holds a new string