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

104
Vistas
How to .map around things inside another .map

I have a main array of options and inside it there are array of values, I am using vanilla js and want to map around the first array (options) and then inside that map, I want to map around another array(values). But this is not working, what can be the solution for this?

test.innerHTML = match_id.options.map((modalVari, indexVariposition) => {
     return   `
    <fieldset class="modal-variant-form">
        <legend class="modal-variant-title">${modalVari.name}:</legend>`
        + modalVari.values.map(varival => (`<li>${varival}</li>`)).join("")
    `</fieldset>
    `
    });

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

this works as expected, so the problem is another

const data = [{name: 'one', values: [1, 2, 3]}, {name: 'two', values: [4, 5, 6]}]

const test = document.getElementById('test')

test.innerHTML = data.map((modalVari, indexVariposition) => {
     return   `
    <fieldset class="modal-variant-form">
        <legend class="modal-variant-title">${modalVari.name}:</legend>
        <ul>${modalVari.values.map(varival => (`<li>${varival}</li>`)).join("")}</ul>
    </fieldset>
    `
    }).join('');
<div id="test"></div>

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