Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
Diferencia en la salida real y requerida en el ejercicio de freecodecamp

He estado tratando de codificar el siguiente ejercicio en freecodecamp y obtengo la misma cadena que se muestra en el resultado deseado, pero la prueba falla en el sitio.

https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/intermediate-algorithm-scripting/convert-html-entities

Código:

 function convertHTML(str) { res = ""; for (let i in str) { if (str[i] == '&') { res= res.concat("&amp;"); } else if (str[i] == '<') { res = res.concat("&lt;"); } else if (str[i] == '>') { res = res.concat("&gt;"); } else if (str[i] == '\"') { res = res.concat("&quot;"); } else if (str[i] == "\'") { res = res.concat("&apos;"); } else { res = res.concat(str[i]); } } return res; }

Cual puede ser la fuente del error

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!