Skip to main content

JavaScript Operators

Arithmetic

OperatorDescription
+Addition
-Subtraction
*Multiplication
**Exponentiation
/Division
%Modulus (Division Remainder)
++Increment
--Decrement

Assignment

OperatorExampleSame As
=x = yx = y
+=x += yx = x + y
-=x -= yx = x - y
*=x *= yx = x * y
/=x /= yx = x / y
%=x %= yx = x % y
**=x **= yx = x ** y

Comparison

OperatorDescription
==equal to
===equal value and equal type
!=not equal
!==not equal value or not equal type
>greater than
<less than
>=greater than or equal to
<=less than or equal to
?ternary operator

Logical

OperatorDescription
&&logical and
||logical or
!logical not