String immutability in JavaScript
String characters can be read but not modified. The following code example will throw an error (in strict mode):
let str = 'abcde';
str[0] = '!';
String characters can be read but not modified. The following code example will throw an error (in strict mode):
let str = 'abcde';
str[0] = '!';