Syntax
Declarations, operators, statements, and language forms.
- async / awaitSyntax for writing promise-based code that reads like ordinary sequential code โ await pauses only the async function it's inside.
- ClassesSyntax over the prototype mechanism โ public and private fields, methods on the shared prototype, and extends for inheritance.
- const and letThe two modern ways to declare a variable binding โ const cannot be reassigned, let can.
- Destructuring, Spread, and RestThree related bits of syntax built on ... and pattern-matching โ pulling values out, copying/combining data, and gathering leftovers.
- Equality Operators (=== and ==)Strict equality (===) never coerces types; loose equality (==) coerces one side according to a specific set of rules.
- for await...of and Async GeneratorsIterates an async iterable โ one whose Symbol.asyncIterator produces promises โ the async counterpart to for...of.
- for, while, and for...ofThree loop forms โ for when counting or indexing, while when the iteration count isn't known up front, for...of when iterating a collection's values.
- Function Declarations, Expressions, and Arrow FunctionsThree syntaxes for creating a function value, differing in hoisting behavior and how they handle this.
- Generators and IteratorsThe Symbol.iterator protocol that powers for...of and spread, and generator functions (function*) as the easiest way to implement it.
- HoistingHow each declaration type โ var, function, let, const, class โ is set up before line-by-line execution begins, and what's accessible before its own line runs.
- if / else and switchBranching statements โ if/else for arbitrary conditions, switch for one value compared against several exact matches.
- import and exportModule syntax for sharing code between files โ any number of named exports, at most one default export per module.
- Optional Chaining (?.) and Nullish Coalescing (??)?. reads a property and stops safely if anything along the way is missing; ?? supplies a fallback only for null or undefined.
- Statements and ExpressionsAn expression produces a value; a statement is a complete instruction that may contain one but isn't one itself.
- Strict ModeAn opt-in restricted variant of JavaScript that turns several silent mistakes into thrown errors.
- Symbols and Well-Known SymbolsA guaranteed-unique primitive type, used as a collision-free object key and to hook user objects into built-in language behavior via well-known symbols.
- Template LiteralsBacktick-delimited strings that support embedded expressions and multi-line text without manual concatenation.
- this, call, apply, and bindthis is determined by a function's call site, not where it's defined; call/apply/bind set it explicitly, and arrow functions have no this of their own.
- try / catch / finallyRuns a block and, if it throws, catches the error instead of crashing the program; finally always runs afterward.