function convertHTML(str) {
let arr = str.split(' ');
let regex = [['&','&'],['<','<'],['>','>'],['"','"'],["'",''']];
for(let x=0;x<arr.length;x++){
for(let i=0;i<arr[x].length;i++){
for(let y=0;y<regex.length;y++){
(arr[x][i] == regex[y][0]) ?
str = str.replace(arr[x][i],regex[y][1]) : false;
}
}
}
return str;
}
console.log(convertHTML("Sixty > twelve"));
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)