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

196
Views
¿Cómo uso la suma y || en una sentencia if else?

Esto es lo que estoy tratando de lograr, pero no está funcionando:

Si el # en Dado 1 + Dado 2 es igual a 7, muestre "¡Tenemos un 7 de la suerte!" De lo contrario, si el # en Dado 1 o Dado 2 es igual a 6, muestra "¡Tenemos un 6!" De lo contrario, muestre "¡No tenemos ganador!"

Este es el código que he escrito en javascript:

 if(randomNumber1 += randomNumber2 === 7) { document.querySelector("h1").innerHTML = "🚩 We have a lucky 7!"; } else if (randomNumber2 || randomNumber1 === 6) { document.querySelector("h1").innerHTML = "We have a 6! 🚩"; } else { document.querySelector("h1").innerHTML = "We have no winner!"; }

¿Qué estoy haciendo mal?

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!