The below describes the usage of operators in JavaScript. The JavaScript provides the below given operators which allows to perform the operations on the operands to evaluate the variable value at run-time.
- Arithmetic Operators
- Comparison /Relational Operators
- Bitwise Operators
- Logical Operators
- Assignment Operators
- Special Operators
Arithmetic Operators in JavaScript
The below given are the Airthmetic operators in the JavaScript
Operator | Description |
---|---|
+ | Addition |
– | Subtraction |
* | Multiplication |
** | Exponentiation |
/ | Division |
% | Modulus |
++ | Increment |
— | Decrement |
Relational Operators in JavaScript
The below given are the Comparison / Relational Operators in JavaScript
Operator | Description |
---|---|
== | 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 |
Bitwise Operators in JavaScript
The below given are the Bitwise Operators in JavaScript
Operator | Description |
---|---|
& | AND |
| | OR |
~ | NOT |
^ | XOR |
<< | Zero fill left shift |
>> | Signed right shift |
>>> | Zero fill right shift |
Logical Operators in JavaScript
The below given are the Logical Operators in JavaScript
Operator | Description |
---|---|
&& | Logical AND |
|| | Logical OR |
! | Logical NOT |
Assignment Operators in JavaScript
The below given are the assignment operators in JavaScript
Operator | Example |
---|---|
= | x = y |
+= | x += y |
-= | x -= y |
*= | x *= y |
/= | x /= y |
%= | x %= y |
**= | x **= y |
2 thoughts on “Operator Types in JavaScript”
Comments are closed.