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

131
Views
how can I put a logic in map array method. I have sent title as props and except props title I want to render other title

This is my code. When I use map method it maps every title in dummy data

Here, when I click bitcoin. Parent component sends bitcoin as title. I don't want to include bitcoin in the select tag. Here, when I click bitcoin. Parent component sends bitcoin as title. I don't want to include bitcoin in the select tag.

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

0

You are returning the option directly from your map function, if you want to add logic inside just add {} and a return statement inside

{coins.map((item) => {
    // you can put your logic here
    // for example just first 2 letters
    const customTitle = item.title.slice(0, 2)
    return (
        <option>{customTitle}</option>
    )
})}

You can read more about arrow functions here

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!