Strings in JavaScript are immutable which means that once a string is defined, it cannot be changed anymore. Trying to change a string with a standard String-function will only create a new string and not affect the original string. Consider the following example, where the value in string1 is not changed:
On the other hand not all defined Array-functions are creating a new array instance, but they rather change and modify the original instance of an array, thus making the array mutable: