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

133
Views
javascript access nested object property

I have the following data structure and I would like some help for the following question

let myObj = { a { a1 [ 1, 2, 3]}, b { b1 [ 4, 5, 6]}} 

also I have an array with two elements [a, b], how can I access my object property from values of array?

I tried for (let i = 0; i < array.length; i++) { console.log(myObj[array[i]] }

somehow I want to get the values from my a1 array but I do not know how to access them

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!