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

110
Views
la función forEach no devuelve valores para agregar a una matriz en JS

Estoy confundido por qué Hold no devuelve nada -> [] en esta función.

Idealmente, necesito ejecutar esta solicitud varias veces, cada respuesta debe agregarse a la matriz. ¿Por qué mis valores no se agregan a esta lista?

 const gather = async (round) => { console.log("RUNNING"); const hold = []; [...Array(round).keys()].forEach(async (x) => { const minLat = -90; const minLon = x; const maxLat = 90; const maxLon = x + 5; const params = `minLat=${minLat}&minLon=${minLon}&maxLat=${maxLat}&maxLon=${maxLon}`; const url = `URLHERE`; const response = await fetch(url); const body = await response.text(); const results = body.split("<raw_text>"); hold.push(results); }); console.log(hold); };
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!