Implement an HTML Entity Converter - Implement an HTML Entity Converter

Tell us what’s happening:

I’m having trouble even getting started. I’ve been reading about escaping online and no matter what i put into Free Code Camp, it doesn’t work.

Even in this forum it doesn’t let me do the longer form of “&” - it converts it to “&”.

You can see what i’m trying to log in my code

what i put the below into FCC - it doesnt give me the same output

Your code so far

function convertHTML(str) {
  let newStr = str.replace("&", "&");
  return newStr;   
}

console.log( convertHTML("Dolce & Gabbana"));
console.log("&");


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36 Edg/139.0.0.0

Challenge Information:

Implement an HTML Entity Converter - Implement an HTML Entity Converter

https://www.freecodecamp.org/learn/full-stack-developer/lab-html-entitiy-converter/implement-an-html-entity-converter

You won’t see your changes in freeCodeCamp’s UI console. You’ll need to open up your browser’s console in dev tools to see the entity replacements.

2 Likes

ok thanks - i’ll just disregard what freeCodeCamp’s UI console says

This actually helped me, thank you!