JavaScript String Replace & ReplaceAll
The replace() method in JavaScript is only replace first occurrence of a substring.
The replace() method accept two parameters.
Example :
const str = "I have Red Car and Red Bike";
const res = str.replace("Red","Blue");
console.log(res); // I have Bl...
codinginterviewpractice.hashnode.dev1 min read