Tell us what’s happening:
I believe my code should work, however it does not pass one of the tests. When I console.log() the particular test however the returned string matches the objective for that particular test.
The test in question is: convertHTML('Stuff in "quotation marks"')
should return Stuff in "quotation marks"
Could someone help me understand why my solution isn’t covering this test? Thanks!
Your code so far
function convertHTML(str) {
// :)
let and = str.replace(/&/g,'&');
let left = and.replace(/</g,'<');
let right = left.replace(/>/g,'>');
let quote = right.replace(/"/g,'"');
return quote.replace(/'/g,''' );
}
console.log(convertHTML('Stuff in "quotation marks"'))
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_4) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15
.
Link to the challenge: