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

132
Views
Filter array by included prefix

I've got the following array :

[David, Daniel, Dude, Dwayne]

How do I get a list of the names that starts with "Da"? The output should be :

[David, Daniel]

Thanks.

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

0

You can use .filter() as -

["David", "Daniel", "Dude", "Dwayne"].filter((element)=> element.startsWith('Da'))

Outputs

Array [ "David", "Daniel" ]

The filter function is applied on an array. Inside this, we are just checking if the element starts with Da, if that condition returns false, the function will filter that element out.

More array methods you can find 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!