Tell us what’s happening:
The code is working perfectly fine in jsfiddle, etc but it is not passing the case : convertHTML(“Schindler’s List”)
Please help. Its working for other code playgrounds.
Your code so far
function convertHTML(str) {
var map = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
};
return str.replace(/[&<>"']/g, function(m) { return map[m]; });
}
console.log(convertHTML("Schindler's List"));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities