DEV Community

Oscar Hernandez
Oscar Hernandez

Posted on

2 1

HTML entities FCC intermediate algorithms

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.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay