⚙️ Operators
Last Updated: 08 Oct 2025
Operators are special symbols that perform actions on values or variables.
Example: 5 + 3 — here + adds two numbers.
Hinglish Tip 🗣: Operators ko aise samjho — chhote tools jo numbers/values par kaam karte hain (add, compare, join, etc.).
🧭 Types of Operators
| Category | Operators | Purpose |
|---|---|---|
| Arithmetic | +, -, *, /, %, ** | Basic math operations |
| =, +=, -=, *=, /=, %=, **=, &=, |=, ^=, <<=, >>= | Store or update variable values | |
| Comparison | ==, ===, !=, !==, >, <, >=, <= | Compare two values (true/false) |
| Logical | &&, ||, ! | Combine or invert boolean conditions |
| Bitwise | &, |, ^, ~, <<, >>, >>> | Work on bits of numbers |
| Unary | ++, -- | Increment/Decrement |
| Ternary (Conditional) | ?: | Short form of if...else |
| Special Operators | ??, ?. | Nullish,Optional Chaining etc |
✏ Mini Example
let a = 7;
let b = 3;
console.log(a + b); // 10 (Arithmetic)
console.log(a > b); // true (Comparison)
console.log(a > 5 && b < 5); // true (Logical)
💡 Don’t worry! We’ll explore each of these in full detail in the next sections.