Logical Operators
Last updated
Last updated
Equal Operator (isEqual)
Not Equal Operator (isNotEqual)
Null Operator (isNull)
Not Null Operator (isNotNull)
Not Operator (not)
Greater than Operator (gt)
Greater than equal to Operator (gte)
Less than operator (lt)
Less than equal to Operator (lte)
Or Operator (or)
And Operator (and)
when we have to check two operands are equal or not than we use Equal Operator. If both the operands are equal than this operator will return true otherwise it will return false.
Arguments
There are two arguments for equal operators (both are required). These arguments are the two operand for which we want to check the equality.
Let's understand it through a real life example
If we want to check the id of first user is equal to 1 or not than we can use Equal operator.
Not Equal Operator (isNotEqual)
when we have to check two operands are not equal than we use Not Equal Operator. If the two operands are not equal than this operation will return true otherwise it will return false.
Arguments
There are two arguments for not equal operators (both are required). These arguments are the two operand for which we want to check the equality.
Let's understand it through an example
Null Operator (isNull)
when we have to check that a value is null or not than we can use isNull operator.
Arguments
There is one argument which is the value we want to check that it is null or not. (It is the required argument).
Let's understand it through an example
Not Null Operator (isNotNull)
when we have to check that a value is not equal to null than we can use isNotNull operator.
Arguments
There is one argument which is the value we want to check that it is null or not. (It is the required argument).
Let's understand it through an example
Not operator will reverse boolean operation. eg.., true into false and vice versa
Arguments
There is only one argument which is required
Example
It will check one number is greater than other or not
It will take two arguments and both arguments are required
Example
It will check one number is greater than equal to other number or not
It will take two arguments and both arguments are required
Example
8. Less than Operator (lt)
It will check one number is Lesser than other or not
It will take two arguments and both arguments are required
Example
It will check one number is lesser than equal to other number or not
It will take two arguments and both arguments are required
Example
It will take two expressions if at least one expression is true than it will evaluate to true otherwise false
Arguments
It will take two arguments and both arguments are required and are boolean expressions
Example
It will take two expressions as argument and evaluate to true only if both the expressions are true otherwise false
Arguments
It will take two arguments and both arguments are required and are boolean expressions
Example
Expression 1 | Expression 2 | Result |
---|---|---|
Expression 1 | Expression 2 | Result |
---|---|---|
true
true
true
true
false
true
false
true
true
false
false
false
true
false
false
false
true
false
true
true
true
false
false
false