JAVA SCRIPT COMPARISON & LOGICAL OPERATORS
COMPARISON OPERATORS
[ X = 5 ]
OPERATOR | DESCRIPTION | COMPARING | RETURNS |
---|---|---|---|
==
|
equal to
|
x==5,==5,=="5"
|
false,true,true
|
===
|
equal value and equal type
|
x===5,x==="5"
|
true,false
|
!=
|
not equal
|
x!=5
|
true
|
!==
|
not equal value or not equal type
|
x!==5,x!=="5",x!==8
|
false,true,true
|
>
|
greater than
|
x>8
|
false
|
<
|
less than
|
x<8 td="">8>
|
true
|
>=
|
greater than or equal to
|
x>=8
|
false
|
<=
|
less than or equal to
|
x<=8
|
true
|
LOGICAL OPERATORS
OPERATOR | DESCRIPTION | EXAMPLE |
---|---|---|
&& | and | (x < 10 && y > 1) is true |
|| | or | (x == 5 || y == 5) is false |
! | not | !(x == y) is true |
Comments
Post a Comment