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

218
Views
¿Cuál es la diferencia entre una matriz como [ ] y (12) {...}, {...}, {...}, etc.

Bien, he buscado por todas partes. No puedo entender por qué mi array.push me da [] y no (#) {...}, {...}, {...}, etc. Aquí está mi código relevante:

 let newArray = []; const fetchAll = async (urls) => { const res = await Promise.all(urls.map(u => fetch(u))) const jsons = await Promise.all(res.map(r => r.json())) for (let i = 0; i < jsons.length; i++) { for (let j = 0; j < 2; j++) { newArray.push({ 'img': jsons[i].hits[j].previewURL }); } } }

Como dije, específicamente quiero que la matriz genere como (#) {...}, {...}, {...} etc. En este momento solo obtengo []. Con la matriz.

Como referencia: quiero que mi conjunto se vea como el archivo console.log inferior. La parte superior es lo que estoy recibiendo. Captura de pantalla de console.log

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!