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

265
Views
Loop through an array inside an object javascript

I have this javascript object children with multiple array inside and the array names are random.

enter image description here

how can i loop through it without specifying 'S801', 'S901' etc so i can get some result like

[52.4655012, 13.2595648], [21.1006158, 79.0074763] , ......

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

0

Use Object.values to get the values in the Object and then map over it.

const obj = {
  children: {
    S801: [52, 13],
    S901: [21, 79]
  }
};

Object.values(obj.children).map(([value1,value2]) => {
  console.log(value1,value2)
})

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!