JavaScript operators are symbols used to perform operations on values and variables. Operators are used for calculations, comparisons, logical conditions, assignments, type checks, and more. This reference provides a clear overview of all major JavaScript operators in tabular form.
Arithmetic Operators
| Operator | Name | Simple Meaning |
|---|
+ | Addition | Adds values |
- | Subtraction | Subtracts values |
* | Multiplication | Multiplies values |
/ | Division | Divides values |
% | Modulus | Remainder after division |
** | Exponentiation | Power of a number |
++ | Increment | Increases by 1 |
-- | Decrement | Decreases by 1 |
Assignment Operators
| Operator | Name | Simple Meaning |
|---|
= | Assignment | Assigns value |
+= | Add and assign | Adds then assigns |
-= | Subtract and assign | Subtracts then assigns |
*= | Multiply and assign | Multiplies then assigns |
/= | Divide and assign | Divides then assigns |
%= | Modulus and assign | Remainder then assigns |
**= | Power and assign | Power then assigns |
Comparison Operators
| Operator | Name | Simple Meaning |
|---|
== | Equal | Value equal |
=== | Strict equal | Value and type equal |
!= | Not equal | Value not equal |
!== | Strict not equal | Value or type not equal |
> | Greater than | Checks greater |
< | Less than | Checks smaller |
>= | Greater than or equal | Checks ≥ |
<= | Less than or equal | Checks ≤ |
Logical Operators
| Operator | Name | Simple Meaning |
|---|
&& | AND | True if both true |
| ` | | ` |
! | NOT | Inverts boolean |
String Operators
| Operator | Name | Simple Meaning |
|---|
+ | Concatenation | Joins strings |
+= | Append | Adds to string |
Bitwise Operators
| Operator | Name | Simple Meaning |
|---|
& | AND | Bitwise AND |
| ` | ` | OR |
^ | XOR | Bitwise XOR |
~ | NOT | Bitwise NOT |
<< | Left shift | Shifts bits left |
>> | Right shift | Shifts bits right |
>>> | Zero-fill right shift | Shifts right with zero fill |
Type and Object Operators
| Operator | Name | Simple Meaning |
|---|
typeof | Type check | Returns data type |
instanceof | Instance check | Checks object type |
in | Property check | Checks property in object |
delete | Delete | Deletes property |
new | Create object | Creates new instance |
void | Undefined | Returns undefined |
Conditional (Ternary) Operator
| Operator | Name | Simple Meaning |
|---|
?: | Ternary | Short if-else |
Spread and Rest Operators
| Operator | Name | Simple Meaning |
|---|
... | Spread | Expands values |
... | Rest | Collects values |
Summary
JavaScript operators are essential for performing calculations, making decisions, working with strings, handling objects, and controlling program logic. Understanding operator categories and their meanings helps in writing clean, readable, and correct JavaScript code.