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

99
Views
React match by id and map to return in div

I am stuck with below, console.log shows correct but in web output there is no values shown. I would appreciate support

const ServicesDetails = [
  ["text1", "text2", "text3"],
  ["text5", "text6", "text7"],
  ["text8", "text9", "text10"]
];

const getServicesDetails = (prop) => {
  let length = ServicesDetails.length
  for (let i = 0; i <= length; i++) {
    if (parseInt(prop) === parseInt(i)) {
        ServicesDetails[i].map(
        (item, e) => {
          console.log(item, e)
          return <div key={e}>{item}</div>
        } 
      )
    }
  } 
}

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

0

return your map https://codesandbox.io/s/condescending-glade-y78p00?file=/src/App.js

    let length = ServicesDetails.length;
    for (let i = 0; i <= length; i++) {
      if (parseInt(prop) === parseInt(i)) {
        return ServicesDetails[i].map((item, e) => {
          return <div key={e}>{item}</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!