hey guys, may anyone please tell me why else if (smallBigReg.test(str)) { return str.replace(smallBigReg, '<>') }
this code not passing? if I try to log it inside the if statement it doesn’t show as well, I am not sure why. Ty
**Your code so far**
function convertHTML(str) {
const andReg = /&/ig;
const smallerReg = /</ig;
const biggerReg = />/ig;
const doubleQuoteReg = /"/ig;
const aposReg = /'/gi;
const smallBigReg = /<>/ig;
if (andReg.test(str)) {
return str.replace(andReg, '&');
}
else if (smallerReg.test(str)) {
return str.replaceAll(smallerReg, '<');
}
else if (biggerReg.test(str)) {
return str.replace(biggerReg, '>');
}
else if (doubleQuoteReg.test(str)) {
return str.replace(doubleQuoteReg, '"');
}
else if (aposReg.test(str)) {
return str.replace(aposReg, ''');
}
else if (smallBigReg.test(str)) {
return str.replace(smallBigReg, '<>')
}
else if (str) {
return str;
}
}
convertHTML("<>");
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36
Challenge: Convert HTML Entities
Link to the challenge: