Tell us what’s happening:
Only the last test is passing. everything else appears to be returning the correct result … I cant understand why this is not being accepted…
Your code so far
function convertHTML(str) {
if(str.match(/&/)){
str = str.replace(/&/, "&")
};
if(str.match(/>/)){
str = str.replace(/>/, ">")
}
if(str.match(/</g)){
str = str.replace(/</g, "<")
}
if(str.match(/"/)){
str = str.replace(/"/, """)
}
if(str.match(/'/)){
str = str.replace(/'/, "'")
}
return str;
}
convertHTML("Dolce & Gabbana");
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities/
