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

149
Views
Mi bucle en JS no funcionará por una razón desconcertante

He estado estudiando JS durante 2 meses y mi maestro me dio esta tarea, así que, como de costumbre, la resuelvo, pero aquí intenté muchas horas pero no puedo. Aunque estoy bastante seguro de que mi respuesta lógicamente es correcta, pero no sé por qué. name repetido solo una vez

La salida requerida es:

String [Osama], [Mohamed], [Ali], [Ibrahim] => Done !

Nota importante: el [] no es una matriz

 /* Function Arrow Challenges */ // [1] One Statement In Function // [2] Convert To Arrow Function // [3] Print The Output [Arguments May Change] let names = function (...name) { for (let i = 0; i < name.length; i++) { return `String [${name[i]}], => Done ~` }}; console.log(names("Osama", "Mohamed", "Ali", "Ibrahim")); // String [Osama], [Mohamed], [Ali], [Ibrahim] => Done !

Pregunta: ¿Cómo podría solucionar esto? con una explicación lógica a la respuesta

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

intente agregar String [${name[i]}], => Done ~ en variable , por ejemplo

 var S+=`String [${name[i]}], => Done ~` return S; 

 /* Function Arrow Challenges */ // [1] One Statement In Function // [2] Convert To Arrow Function // [3] Print The Output [Arguments May Change] let names = function (...name) { for (let i = 0; i < name.length; i++) { return `String [${name[i]}], => Done ~` }}; console.log(names("Osama", "Mohamed", "Ali", "Ibrahim")); // String [Osama], [Mohamed], [Ali], [Ibrahim] => Done !

about 4 years ago · Juan Pablo Isaza Report
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!