JavaScript Operators

Yepkoo

Yepkoo
Staff member
OperatorData TypeDescription
==anyTests for equality
(performs implicit data type conversion)
!=anyTests for inequality
(performs implicit data type conversion)
===anyTests for equality and same data type
!==anyTests for equality and same data type
>numbers, stringsGreater Than
>=numbers, stringsGreater Than or Equal
<numbers, stringsLess Than
<=numbers, stringsLess Than or Equal

OperatorData TypeDescription
+numbersAddition
-numbersSubtraction
*numbersMultiplication
/numbersDivision
%numbersRemainder after division is performed
++numbersIncrement
(pre-increment or post-increment)
--numbersDecrement
(pre-decrement or post-decrement)

OperatorData TypeDescription
=any variableAssign value
+=any variableAdd and assign value
(same as h = h + 3)
-=any variableSubtract and assign value
(same as h = h - 12)
*=any variableMultiply and assign value
(same as h = h * 7)
/=any variableDivide and assign value
(same as h = h / 5)
%=any variableDivide and assign remainder value
(same as h = h % 10)
<<=any variableLeft shift and assign value
(same as h = h << 3)
>>=any variableRight shift with sign extension and assign value
(same as h = h >> 9)
>>>==any variableRight shift with zero extension and assign value
(same as h = h >>> 17)
&=any variableBitwise AND and assign value
(same as h = h & 6)
^=any variableBitwise XOR and assign value
(same as h = h ^ 4)
|=any variableBitwise OR and assign value
(same as h = h | 50)

OperatorData TypeDescription
&&booleanLogical AND
||booleanLogical OR
!booleanLogical NOT
(inverts the boolean value)

OperatorData TypeDescription
+stringConcatenate
+=stringConcatenate by appending to the end of the string

OperatorData TypeDescription
&integer
(32 bit number)
Bitwise AND
^integer
(32 bit number)
Bitwise XOR
|integer
(32 bit number)
Bitwise OR
<<integer
(32 bit number)
Left shift
>>integer
(32 bit number)
Right shift with sign extension
>>>integer
(32 bit number)
Right shift with zero extension
 
Top