Alterar string com string js
var str ="Hello World!";
str.replace("Hello", "Hi");
Snippets
var str ="Hello World!";
str.replace("Hello", "Hi");
let string = "Hello World";
string = "Hello JavaScript"; // Easy as that!