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

93
Views
¿Cómo puedo expresar que dos índices de matriz también son iguales a cualquiera de los valores en una declaración condicional?

en Javascript, ¿cómo puedo expresar que si array1[i] y array2[j] también son iguales a "0", "O" o "Q", entonces array1[i] es igual a array2[j]? He intentado de varias maneras pero no funcionó. Gracias.

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

o

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

0

Puede usar otra matriz para verificar si incluye el valor de la matriz [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!