Do you know what will be the output of this code?
JavaScript
const str = "hello";
str[0] = "H";
console.log(str);
Show answer and explanation
The answer is "hello".
Strings can’t be changed in place. The assignment is silently ignored (in strict mode it throws). Build a new string: "H" + str.slice(1).