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

210
Views
What is the difference between an array like [ ] and (12) {...}, {...}, {...}, etc

Okay, I have searched far and wide. I can't figure out why my array.push gives me [] and not (#) {...}, {...}, {...}, etc. Here is my relevant code:

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
            });
        }
    }
}

Like I said, I specifically want the array to output like (#) {...}, {...}, {...} etc. Right now I'm just getting [ ]. With the array.

For reference: I want my array to look like the bottom console.log. The top is what I'm getting.Screenshot of 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!