Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda