Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

127
Vistas
How to avoid writing multiple operators in If statement

I'm interested if it's possible to avoid using multiple operators to make an if statement when you want to check a similar condition for multiple variables. for example :

var good = 0;
var bad = 0;
var neutral = 0;

if(good === 0 && bad === 0 && neutral === 0){
  DO SMTH . . . 
}

instead of this if there's something that does it similar to the following :


if(good,bad and neutral === 0){
  do smth . . . 
}

So basically, just to avoid multiple operators. thank you!

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Well... what about this

def total = good + bad + neutral; 

if (total === 0) { 
   // do something
}

This works only if you are sure values are positive values.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda