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

124
Views
How do you refer to an object within an object using index positions? Javascript

Say I have some objects like what's shown below. What I want to do is refer to the index positions in myObjects. For example, myObjects[0].parameter1 would be give me blue. However referencing stuff by index positions doesn't seem to work in objects. Am I just getting the syntax wrong or is this just not possible with javascript?

let myObjects= {
     objectA:{
         parameter1: blue,
         parameter2: 5,
     },
     object B:{
         parameter1: orange,
         parameter2: 4,
     },
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Updated post below

let myObjects = [
    {
      parameter1: 'blue',
      parameter2: 5,
    },
    {
      parameter1: 'orange',
      parameter2: 4,
    },
  ]

  let obj = myObjects.find(o => o.parameter1 === 'blue');
  console.log(obj)

I also included how you can find that object with a specific parameter, in this case blue and then return it to a variable. Obviously im just console logging the object, but you can use it for whatever you want.

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!