Section 01 of 05

What JavaScript and TypeScript actually specify

ECMAScript semantics and TypeScript’s type system, read from the specification and the compiler rather than from the documentation.

The documentation describes how a feature is meant to behave. The specification describes what an engine is required to do, and the compiler describes what it will actually accept. These articles work from the second two, and they say which one a claim came from.

Articles
3
Latest
Series
2
  1. №03
    The TypeScript type system

    Your Conditional Type Answered Twice. Both Answers Are Right.

    A naked type parameter splits its union before the conditional runs, so IsArray<string[] | number> comes back as 'no' | 'yes'. Read out of TypeScript 7.0.2.

  2. №02
    Async machinery

    What await Compiles To, and What It Costs

    One async function compiled three ways — TypeScript's ES5 emit, V8's bytecode and the spec's Await steps — and the microtask turns each one predicts.

  3. №01
    The TypeScript type system

    Type-Level Narrowing: How TypeScript Decides What You Meant

    Control flow analysis is a graph walk over your code. Knowing what widens a type again explains most of the errors that look wrong.

Browse

Other sections

Arrow keys to move, Enter to open.