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

101
Views
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 answers
Answer question

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 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!