JS Operators
JavaScript operators perform arithmetic, assign values, compare values, and more.
Operators are symbols that perform operations on operands (values and variables). JavaScript has operators for arithmetic, assignment, comparison, and logic.
Try It — All Operator Types
Preview
Operator Quick Reference
| Type | Operators | Example |
|---|---|---|
| Arithmetic | + - * / % ** | 10 % 3 → 1 |
| Assignment | = += -= *= /= | x += 5 |
| Comparison | == === != !== > < >= <= | 5 === "5" → false |
| Logical | && || ! | true && false → false |
| String | + | "Hi" + " there" |
Tip: Always use
===(strict equality) instead of==. It checks both value AND type, preventing sneaky"5" == 5bugs.