I want to replace all the characters "<" and ">" with "<" and ">" respectively from a string.
I tried this code but it didn't worked for me -
// theMainString is the string from which I want the characters replaced
let theMainString = "<div>Hello World</div>";
let s1, s2;
s1 = (theMainString).replace("<", "<");
s2 = s1.replace(">", ">");
console.log(s2);
// Output: "<div>Hello World</div>"
Any help would be highly appreciated