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

146
Views
find a string starting with a number of letter

I have an id auto incrementing (DFL_WER_101, DFL_WER_102 ,DFL_WER_103). I am trying to find a js function sort of like startWith(), but basically I want to select all field starting with DFL_WER_ no matter the number

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

0

You can use Array.prototype.filter() combined with String.prototype.startsWith():

const data = ['DFL_WER_101', 'DFL_WER_102', 'DFL_WER_103', 'ASDF_10000000000']
const result = data.filter(s => s.startsWith('DFL_WER_'))

console.log(result)

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!