JavaScript замените строку
var str = "JavaScript replace method test";
var res = str.replace("test", "success");
//res = Javscript replace method success
Batman
var str = "JavaScript replace method test";
var res = str.replace("test", "success");
//res = Javscript replace method success
var string="hollo"
console.log(string.replace(/o/g,'P'))
//replace o with P
str.replace('tobereplaced', 'replacement'),