Tell us what’s happening:
Only #6 passes for some reason while all the other conversions fail and I have no idea why. Why does this one work while all the others do not??
Your code so far
function convertHTML(string) {
let result = string.replaceAll("&", "&");
result = string.replaceAll("<", "<");
result = string.replaceAll(">", ">");
result = string.replaceAll("\"", """);
result = string.replaceAll("\'", "'");
console.log(result);
return result;
}
convertHTML("Dolce & Gabbana")
convertHTML("Hamburgers < Pizza < Tacos")
convertHTML('Stuff in "quotation marks"')
convertHTML("Schindler's List")
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64; rv:155.0) Gecko/20100101 Firefox/155.0
Challenge Information:
Implement an HTML Entity Converter - Implement an HTML Entity Converter