Tell us what’s happening:
I’m having trouble getting my “replace” function working within this lab. I’ve checked the Chome Console through Dev Tools and I’m not seeing the right outputs there either. Am I missing some syntax, or am I approaching this problem the wrong way? Thanks!!
Your code so far
function convertHTML (string) {
let result = string;
result = result.replaceAll("&", ">&");
result = result.replaceAll("<", "<");
result = result.replaceAll(">",">");
result = result.replaceAll("\"", """);
result = result.replaceAll("\'", "'");
return result;
};
console.log(convertHTML("Dolce & Gabbana"));
// Output: Dolce & Gabbana
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/149.0.0.0 Safari/537.36
Challenge Information:
Implement an HTML Entity Converter - Implement an HTML Entity Converter