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

126
Views
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 answers
Answer question

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 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!