Tell us what’s happening:
one of those coding exercises
Intermediate Algorithm Scripting: Convert HTML Entities
Your code so far
function convertHTML(str) {
const map = new Map();
map.set('&', '&')
map.set('<','<')
map.set('>','>')
map.set('\"','"')
map.set('\'', ''')
return str.split('')
.map( (char) => map.has(char) ? map.get(char) : char)
.join('')
}
console.log(convertHTML("Schindler's List"));
Link to the challenge:
yoelvis
2
You has copied not visible chars. Try replace it in your code. Avoid copy and paste.
1 Like