save up to 40%

What are boolean operators?

Are you preparing for IT certification? With practice questions, study notes, interactive quizzes, tips and technical articles, uCertify PrepKits ensure that you get a solid grasp of core technical concepts to ace your certification exam in first attempt.

What are boolean operators?

Rating:



The boolean operators are used to check more than one condition at a time. There are situations where the JavaScript programmers have to evaluate two or more conditions and the result is based on the result of all the conditions.

There are three kinds of boolean operators as follows:

  1. &&
  2. ||
  3. !

In the case of the && operator, the result is true only if all the conditions are true. In the given conditions, if a condition is false, the result will be false.

The following table shows the result of evaluating two conditions:

Condition 1 And Operator Condition 2Result
True &&True True
True &&False False
False &&True False
False &&False False

In the case of the || operator, the result is false only if both the conditions are false. Otherwise, the result is true.

The following table shows the result of the or operator:

Condition 1 Or Operator Condition 2Result
True ||True True
True ||False True
False ||True True
False ||False False

In the case of the not operator, if the condition is not false, it is true. If the condition is not true, it is false

The following table shows the result of the not operator:

Condition Not Operator Result
True!False
False !True


Rating:



Other articles

Click here to Article home

 
uCertify.com | Our Company | Articles | Privacy | Security | Contact Us | News and Press Release | uCertify India
MCSE: MCSA, MCTS, MCITP    JAVA Certification: SCJP, SCWCD Cisco Certification: CCNA, CCENT, A+, Network+, Security+
Oracle Certification: OCP 9i, OCP 10g, OCA 9i, OCA 10g CIW foundation    EC-212-32    CISSP    Photoshop ACE    Adobe Flash ACE
© 2008 uCertify.com. All rights reserved. All trademarks are the property of their respective owners.