Hi All
My solution to the Replace HTML entities (intermediate algorithm scripting) passes all the test cases but the challenge doesn’t get completed when I run the code. Any idea what the cause of this could be?
My code:
function convertHTML(str) {
var entities = {
'&': 'amp;',
'<': 'lt;',
'>': 'gt;',
'"': 'quot;',
"'": 'apos;'
};
return str.split('').map((e) => {
return entities[e] || e;
}).join('');
}
convertHTML("<>")
