JavaScript in Depth

Цикл про ядро языка: типы и приведение, область видимости и замыкания, прототипы, ссылки и копирование, промисы изнутри, итераторы и генераторы.

JavaScript is easy to start and hard to understand: the language forgives almost everything and silently does "something" where other languages crash. This series is about the core: eight mechanisms everything else is made of. Not a syntax reference — an explanation of why the language behaves the way it does.

Eight articles go in order — each builds on the previous ones:

  1. Types in JavaScript — primitives and objects, typeof, NaN, value versus reference.
  2. Type coercion — ==, ===, truthy/falsy and why [] + [] is an empty string.
  3. Scope — var/let/const, hoisting, the dead zone and the classic loop puzzle.
  4. Closures — a function carries its scope along: privacy, factories, stale closures.
  5. Prototypes — delegation, prototype versus proto and class as sugar.
  6. References and copying — shallow/deep copies, structuredClone and why immutability.
  7. Promises from the inside — then chains, how errors travel, async/await and combinators.
  8. Iterators and generators — the iteration protocol, yield and for await..of.

The this and event loop topics live in the neighboring section — this: call context and Event loop — and together with this series they cover the language core completely.

The series is part of the Frontend program as a phase between TypeScript basics and React: hooks, state, and rendering stand on closures, references, and immutability — with this foundation React stops being magic.