Intermediate Algorithm Scripting - Convert HTML Entities

I have just put together my first pass and don’t know why my console.log() is not generating anything for me to start debugging. I don’t want commentary on the code, just an explanation why my console.log() is generating nothing.

  **Your code so far**
function convertHTML(str) {

convertHTML("Dolce & Gabbana");
const arr = [];
for (let i = 0; i < str.length; i++) {
  HTMLcoder(str[i],arr);
}

let HTMLcoder = function(char, HTMLcode) {
  switch (char) {
    case "&":
      HTMLcode.push("&amp;");
      break;
    case "<":
      HTMLcode.push("&lt;");
      break;
    case ">":
      HTMLcode.push("&gt;");
      break;
    case "'":
      HTMLcode.push("&apos;");
      break;
    case '"':
      HTMLcode.push("&quot;");
      break;
    default:
      HTMLcode.push(char);
  }
  console.log(HTMLcode, arr, str);
  console.log(arguments);
}
return coded=arr.join("");
console.log(coded);
}
  **Your browser information:**

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

Challenge: Intermediate Algorithm Scripting - Convert HTML Entities

Link to the challenge:

I had moved stuff around and it ended up at the top accidentally. Thx.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.