JavaScript Operators
Arithmetic Operators
| Operator | Description |
|---|---|
| + | Addition |
| - | Subtraction |
| * | Multiplication |
| / | Division |
| & | Modulus |
| ** | Exponentiation |
| ++ | Increment |
| -- | Decrement |
Assignment Operators
| Operator | Equal To |
|---|---|
| = | x = y |
| += | x += y |
| -= | x -= y |
| *= | x *= y |
| /= | x /= y |
| &= | x &= y |
| **= | x **= y |
Comparison Operators
| Operator | Description |
|---|---|
| == | Equal to |
| != | Not equal to |
| === | Equal to and of the same type |
| !== | Not equal to or not of the same type |
| > | Greater than |
| < | Less than |
| >= | Greater than or equal to |
| <= | Less than or equal to |
Logical Operators
| Operator | Description |
|---|---|
| && | Logical AND - Returns true if both operands are true, otherwise returns false. |
| || | Logical OR - Returns true if either operand is true, otherwise returns false. |
| ! | Logical NOT - Returns true if the operand is false, otherwise returns false. |
| ?? | Nullish Coalescing - If left side is null or undefined, return right side. Otherwise, return left side. |