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

104
Views
How can I express that two array indexes also equal to either one of the values in a conditional statement?

in Javascript, how can I express that if array1[i] and array2[j] also equal to either "0", "O" or "Q", then array1[i] is equal to array2[j]? I have tried multiple ways but it didn't work. Thanks.

if ((array1[i] == "0" || "O" || "Q") && (array2[j] == "0" || "O" || "Q")){
          array1[i] == array2[j];
}

or

if ((array1[i] && array2[j]) == "0" || "O" || "Q"){
              array1[i] == array2[j];
}
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

You can use another array to check whether it includes value of array[i]

const oArr = ["0", "O", "Q"]
if (oArr.includes(array1[i]) && oArr.includes(array2[j])) {
  console.log("They both have 0, O or Q")
}
about 4 years ago · Santiago Gelvez 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!