Loading topic
tsc or open a project in a TypeScript-aware editor. You should also understand what a data type such as string or number means.1 min readtsc, and have strict enabled in tsconfig.json. Primitive types are the simplest types in TypeScript. Every other type is built from them.1 min readlet n: number, that you can run code with tsc or an editor with TypeScript support, and that you understand the strict compiler option. Inference is the compiler's way of working out a type without you writing it. Knowing what 1 min read"on" | "off" means. You should also be comfortable reading errors from tsc.1 min readtsc or use a TypeScript-aware editor, and have read about union types. Arrays and tuples are the two main ways to type a list of values. An array holds any number of items that share one type. A tuple holds a fixed number of items2 min readstring, number, boolean), basic type annotations, and simple union types such as string | undefined. The examples assume "strict": true in your tsconfig.json, which enables strictNullChecks.2 min readstring, number, and boolean. You should also be able to run tsc or use an editor that shows TypeScript errors.1 min readstring | number, and edit a tsconfig.json file. You should also know that JavaScript has two "empty" values: null, which a program sets on purpose, and undefined, which appears when a value was never set.2 min readconst and let, and how typeof checks work in JavaScript. It builds on the inference rules from earlier in the tutorial.1 min readstring | number), basic if and switch statements, and how strict mode enables strictNullChecks. A union type means a value can be one of several types. Narrowing is the compiler's process of shrinking that set based on checks in your code.2 min readtypeof. You should also be comfortable with JSON.parse returning data of unknown shape, and with running tsc in strict mode.2 min readswitch statements. You should also know that a function with no return statement hands back undefined at runtime.2 min readmap and filter.2 min readunknown type. You should also be comfortable reading compiler errors from tsc or your editor.2 min readconst and let, and how to run tsc or use a TypeScript-aware editor. It also assumes you have read the earlier sections on literal widening and union types.2 min readconst and let infer different types, and can write object and union types. You should also be able to run tsc or use an editor with TypeScript support.1 min read