JavaScript Operators
Overview
About this index
Operators build expressions: compare values, combine booleans, create instances, and compute numbers. Open a guide below for syntax and beginner examples.
Index
Topics
| Topic | Summary |
|---|---|
typeof | check the type of a value, common return strings, and typeof null quirks. |
instanceof | test whether a value appears in a constructor’s prototype chain. |
=== and == | strict equality, loose equality with coercion, and when to prefer ===. |
?. | safely read nested properties and call methods when something may be nullish. |
?? | choose a default only when a value is null or undefined—not for 0 or empty string. |
&& || ! | &&, ||, and ! for combining booleans and short-circuit patterns. |
Assignment | =, +=, -=, and logical assignments &&= ||= ??= |
new | create an instance from a constructor or class, what new does step by step. |
delete | remove an object property, what delete returns, and what you cannot delete. |
void | evaluate an expression and always get undefined—common in bookmarklets and IIFEs. |
?: | condition ? ifTrue : ifFalse as a compact expression form of if/else. |
in | check whether a property name exists in an object (including inherited). |
+ - * / % ** | add, subtract, multiply, divide, remainder, and exponentiation with beginner examples. |
Comparison | < > <= >= ordering. |
Bitwise | & | ^ ~ and shifts. |
++ -- | prefix and postfix update. |
Template literals | backticks and ${} interpolation. |
Property accessors | dot and bracket reads/writes. |
yield | pause generators; yield*. |
super | parent constructor and methods. |
Logical assignment | &&= ||= ??=. |
new.target | detect construct calls. |
Frequently Asked Questions
Start with typeof, ===, then ?. and ??.
No. Operators form expressions that produce values; statements use those values.
CODETOFUN NEWS
Stay Ahead in Tech
Get the latest IT news, programming updates, and technology trends directly on your phone.
Your daily dose of tech, straight to your feed.
6 people found this page helpful
