Posted on June 9, 2016
// Mistake var str = "David is an Arsenal fan, which means David is great"; str.replace("David", "Darren"); // "Darren is an Arsenal fan, which means David is great" // Desired str.replace(/David/g, "Darren"); // "Darren is an Arsenal fan, which means Darren is great"
Recent Comments