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

83
Vistas
Grouping json object

I am creating dynamic variation and this is my JSON output for variation.

[
    {
        variant: {
            name: 'Size',
            code: 'size',
            type: 'text',
            options: [
                {value: 'Small'},
                {value: 'Medium'},
                {value: 'Large'},
                {value: 'Extra Large'},
            ]
        }
    },
    {
        variant: {
            name: 'Color',
            code: 'color',
            type: 'text',
            options: [
                {value: 'Red'},
                {value: 'Green'},
                {value: 'Blue'},
            ]
        },
    }
]

Now i want to group the options value to get the below result from above JSON. But it is totaly not making me send how i'll group it like that.

    props.modelValue.forEach(({variant}) => {
        variant.options.forEach((value) => {
            console.log(value)
        });
    });


[
        {'size':'Small','color':'Red'},
        {'size':'Small','color':'Green'},
        {'size':'Small','color':'Blue'},

       {'size':'Medium','color':'Red'},
       {'size':'Medium','color':'Green'},
       {'size':'Medium','color':'Blue'},

       {'size':'Large','color':'Red'},
       {'size':'Large','color':'Green'},
       {'size':'Large','color':'Blue'},

       {'size':'Extra Large','color':'Red'},
       {'size':'Extra Large','color':'Green'},
       {'size':'Extra Large','color':'Blue'},
    ]
about 4 years ago · Santiago Trujillo
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