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

272
Views
How to use toLowerCase() function before filter?

enter image description here

I want to lowercase product.productName before filter, but I couldn't do that. I tried some thing but didn't work. Is there any way that I can lowercase product.productName before filter?

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

0

.map() could be used as a step before filter()

products
  .map(product => product.productName.toLowerCase())
  .filter(...)
about 4 years ago · Juan Pablo Isaza Report

0

Simply convert to lowercase inside filter before comparing.
e.g.
product.productName.toLowerCase().includes .....

If it complains about being an object, convert to string first.

product.productName.toString().toLowerCase().includes ....

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!