Skip to main content

JAVA SCRIPT COMPARISON & LOGICAL OPERATORS

JAVA SCRIPT COMPARISON & LOGICAL OPERATORS

COMPARISON OPERATORS
[ X = 5 ]
OPERATORDESCRIPTIONCOMPARINGRETURNS
==
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="">
true
>=
greater than or equal to
x>=8
false
<=
less than or equal to
x<=8
true

LOGICAL OPERATORS
OPERATORDESCRIPTIONEXAMPLE
&&and(x < 10 && y > 1) is true
||or(x == 5 || y == 5) is false
!not!(x == y) is true

Comments