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

142
Views
Why use !== when you can use ===?

I could simply vice versa the code to be executed by the if and else. And === is more easier to use compared to !== so why is the not equal operator used?

function equality( number ){
    if ( number === 7 ){
        return "it's equal"
    } else { return "not equal"}
}
 console.log(equality(7))

function nonEquality( number ){
    if ( number !== 7 ){
        return "it's not equal"
    } else { return "it's equal"}
}
console.log(nonEquality(7));
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You cannot use conditional statements to convert the operators for most common cases. In your example, it would be easy and readable to convert the non-equal operator to equal operator by using if-else. But what if a condition like this?

if(i > 4 && i < 10 && i !== 8)

Do you want to apply converting logic here to replace the non-equal operator? The more you convert, then more complicated and unreadable your code is.

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!