.replace() Method
var wrong = "Your baby is going to be awesome regardless of it's gender.";
//replace it's with its
var notWrong = wrong.replace("it's", "its");
console.log(notWrong);`Your baby is going to be awesome regardless of its gender.`.replace("old", "new");var str = "I have experience with HTML, C#, and javascript. Javascript is the language I enjoy the most.";
//search for any instance of "javascript" and replace it with "JavaScript"
var strNew = str.replace(/javascript/gi, "JavaScript");
console.log(strNew);Last updated