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

112
Views
JavaScript Cancel Async list.filter Function

I have a list that looks something like this:

list = [
    { name: 'name1', age: 30 },
    { name: 'name2', age: 35 }
]

There are potentially hundreds of thousands of entries in the list.

I am executing something like this:

function myFunc(query) {
    return list.filter(item => {
        return item.name.includes(query)
    })
}

myFunc('Hello, World!')

I want to run myFunc "in the background", and I want to be able to abort the execution of the function before it finishes its execution. How can I do that?

about 4 years ago · Juan Pablo Isaza
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!