loading...

HTML entities FCC intermediate algorithms

95freedom95 profile image Oscar Hernandez ・1 min read

published: true

tags: replit, nodejs

function convertHTML(str) {
var args = ["\""];
var arr1 = str.replace("&", "&").replace("<", "<").replace("<", "<").replace(args, """).replace(args, """).replace(">", ">").replace("'s", "'s");
console.log(arr1)
return arr1
}

convertHTML("Dolce & Gabbana");

convertHTML("Hamburgers < Pizza < Tacos");
convertHTML("Sixty > twelve") ;
convertHTML('Stuff in "quotation marks"');
convertHTML("Schindler's List");
convertHTML("<>");
convertHTML("abc");
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities.

Discussion

markdown guide