Tell us what’s happening:
Hello!
Can you guys take a look at the code below and help me find out why fcc refuses to accept it?
I belive it’s correct. What am I missing?
Your code so far
function convertHTML(str) {
// :)
let textArray = Array.of('&',"<",'>','"',"'");
let htmlArray = Array.of('&','<', '>', '"', ''');
let conversion = [];
for (let ch in str) {
let index = textArray.indexOf(str[ch]);
if (index > -1) {
conversion.push(htmlArray[index]);
} else {
conversion.push(str[ch]);
}
}
return conversion.join('');
}
convertHTML("<>")
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15
.
Link to the challenge: