Course Banner


Javascript Operators

Operators in JavaScript are very similar to operators that appear in other programming languages. The definition of an operator is a symbol that is used to perform an operation. Most often these operations are arithmetic (addition, subtraction, etc), but not always.
Javascript arithmetic operator chart
Operator
English
Example
+
Addition
2+2=4
-
Subtraction
4-2=2
*
Multiplication
2*2=4
/
Division
2/2=0
%
Modulo
3%2=1
COMPARISON OPERATORS
Operator
English
Example
Result
==
Equal
x==y
true
!=
Not Equal
x!=y
false
<
Less than
x true
>
Greater than
x>y
false
<=
Less than equals to
x<=y
true
>=
Greater than eqal to
x>=y
false
LOGICAL OPERATORS
Operator
English
Example
&&
AND
(x < 10 && y > 1) is true
||
OR
(x==5 || y==5) is false
!
NOT
!(x==y) is true