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

110
Views
How to map another object of arrays after a map?

I have data that looks like

[{subCategory: "subCategory", 
  name: "name",
  data: [{
  GradeName: "grade", 
  Population: "population",
  }]
}]

and I am running this code in my component

{currentCoinData.map((coin) => (
          <tr key={coin.id}>
            <td>{coin.subCategory}</td>
            <td>{coin.fullName || coin.coinName}</td>
            <td></td>
          </tr>
        ))}

How can I map the data key from the array of objects onto the td jsx component?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

just use another map function inside you map function:

{currentCoinData.map((coin) => (
          <tr key={coin.id}>
            <td>{coin.subCategory}</td>
            <td>{coin.fullName || coin.coinName}</td>
            {coin.data.map(item =>
                <td key={item.GradeName}>
                    {item.GradeName} {item.Population}
                </td>
            )}
          </tr>
        ))}
about 4 years ago · Juan Pablo Isaza Report

0

You can use .map inside a .map just fine:

{currentCoinData.map((coin) => (
          <tr key={coin.id}>
            <td>{coin.subCategory}</td>
            <td>{coin.fullName || coin.coinName}</td>
            <td>{coin.data.map(item =>
                    <span key={item.GradeName}>{item.GradeName}</span>)}
            </td>
          </tr>
        ))}
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!