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

127
Views
How to use forEach to check if there is a match in the array (JavaScript)

How to use forEach to check if there is a match in the array (JavaScript)

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

0

I'm not sure exactly what you're asking; how do you "log out" variables in code?

In general, you don't need a loop to check existence an array; that's what the Array.includes method is for:

if (files.includes(upload.type)) {
    console.log("type is OK")
} else {
    console.log(`type ${upload.type} not found`)
}
about 4 years ago · Juan Pablo Isaza Report

0

const isMatch = files.some((type) => upload.type === type);

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!