TypeScript flashcards
JavaScript with a type checker: catch bugs at edit time, model your domain and refactor large codebases safely.
What is TypeScript, in one plain sentence?
TypeScript is JavaScript with labels that say what kind of value each thing holds, plus a checker that warns you about mistakes before the code runs.
Tap to turn over. Swipe right if you know it, left to see it again.
What you will learn
Start from zero
- What TypeScript is and why it exists4 cards
- Values, objects and functions3 cards
- Types and tooling words3 cards
- Before and after this topic2 cards
Core basics
- Why types, and inference4 cards
- Typing values, functions and objects3 cards
- type, interface, literal unions and tuples3 cards
- Safety: outside data, runtime checks and readonly3 cards
- Running TypeScript, tsconfig and editor tools3 cards
- Classes2 cards
Next steps
- Narrowing and unions4 cards
- Generics3 cards
- Utility types4 cards
- Deriving types from values2 cards
- Team conventions, enums and imports4 cards
Go deeper
- Conditional, infer and template literal types5 cards
- Exhaustiveness and branded types2 cards
- Strict flags and migration3 cards
- Boundaries, declarations and publishing3 cards
- Modern syntax: using and const type parameters2 cards
- Variance and compiler performance3 cards
Final test and certificate
10 questions drawn fresh from the whole topic, about 15 minutes. Sign in, score 80% or more and get a free certificate with your name and a public check link anyone can open, such as an employer or a teacher. Not signed in? Try a practice test from the cards.
Take the final testAbout these cards
- Reviewed 26 October 2026
- CoversTypeScript 7.0 (native compiler, July 2026)TypeScript 6.0 for tools that need the compiler APINode.js 24 LTS type strippingECMAScript 2025
Checked against
TypeScript at a glance
TypeScript is JavaScript with labels for each kind of value, plus a checker that catches mistakes before the code runs.
Like labels on kitchen jars: they warn you before you put salt in the tea.
Words you will meet
- Type
- The kind of value something holds, like number or text
- Variable
- A named box that holds a value
- Property
- One named part of an object, like name or age
- Annotation
- A type you write yourself after a colon
- Interface
- A named description of an object's shape
- Union
- A type that allows one of several choices
- Compile
- Turn TypeScript into plain JavaScript by removing the labels
- Runtime
- The moment the code actually runs
The steps
- 1. Start from zero (12 cards): What TypeScript is, the words it uses, and your first type error.
- 2. Core basics (18 cards): Annotations, inference, unions, interfaces and how TypeScript runs in 2026.
- 3. Next steps (17 cards): Narrowing, discriminated unions, generics, utility types, as const and satisfies.
- 4. Go deeper (18 cards): Conditional and mapped types, exhaustiveness, branding, strictness flags, runtime validation and compiler internals.
All 12 cards in Start from zero
- What is TypeScript, in one plain sentence?
- TypeScript is JavaScript with labels that say what kind of value each thing holds, plus a checker that warns you about mistakes before the code runs.
- What went wrong in plain JavaScript before TypeScript?
- A typo like
user.emial, or text sent where a number was needed, showed up only when the page broke for a real user. TypeScript points at it while you type. - Where do you already meet TypeScript in daily life?
- Many big apps and websites you use are written in it, and so are popular code editors. If an editor ever underlined a mistake in red as you typed code, a checker like this was at work.
- What everyday thing is TypeScript like?
- Labels on kitchen jars. If someone reaches for the jar marked 'sugar' to sweeten tea and it is really salt, the label warns him before he spoils the cup.
- What are a 'value', a 'variable' and a 'type'?
- A value is a piece of data, like
42or"Arun". A variable is a named box that holds a value (made withconstorlet), and its type is the kind of value:number,string(text) orboolean(trueorfalse). - What are an 'object', a 'property' and an 'array'?
- An object groups named values, like
{ name: "Arun", age: 12 }; each named part is a property. An array is an ordered list, like[10, 20, 30]. - What are a 'function', a 'parameter' and a 'return value'?
- A function is a named set of steps you can reuse. A parameter is an input it receives, and the return value is what it gives back; code that uses the function is its caller.
- What do 'interface', 'union',
nullandundefinedmean? - An interface is a named description of an object's shape: which properties it has and their types. A union means 'one of these', written with
|, andnullandundefinedboth mean no value. - What do 'compile', 'runtime',
tscand 'bundler' mean? - To compile here is to turn TypeScript into plain JavaScript by removing the labels; runtime is when the code actually runs.
tscis the TypeScript checker, set up bytsconfig.json, and a bundler packs your files for the browser. - What do you need before starting?
- A little JavaScript, a code editor such as VS Code (it understands TypeScript out of the box) and Node.js, which runs JavaScript on your computer.
- Your first tiny win: why is the second line an error?
: numberis a type label, called an annotation:agemust hold a number. Putting text in it makes TypeScript show an error before anything runs.- What will you be able to do after this topic?
- Add types to your JavaScript, describe your data with interfaces and unions, read type errors calmly, and change big code safely.
TypeScript cheatsheet
Everyday types
string[] / readonly T[]Arrays, mutable or notRecord<"a" | "b", V>Object with exactly those keys"draft" | "live"Literal union[lat: number, lng: number]Labelled tupleunknownAnything, must narrow firstneverImpossible value, exhaustiveness(e: Event) => voidFunction type
Utility types
Partial<T> / Required<T>All optional / all requiredPick<T, K> / Omit<T, K>Keep / drop keysReadonly<T>No writes, shallowReturnType<typeof fn>Function result typeParameters<typeof fn>Argument tupleAwaited<T>Unwrap promisesNonNullable<T>RemovenullandundefinedExtract<U, X> / Exclude<U, X>Filter a union
Operators
keyof TUnion of keysT[K]Type at a keytypeof valueType of a variablevalue as constLiteral, readonlyvalue satisfies TCheck, keep inferred typex is TType guard return<const T>Infer literals for a parameter
Type-level patterns
T extends U ? X : YConditional typeinfer RCapture part of a match{ [K in keyof T]: ... }Mapped type[K in keyof T as `get${Capitalize<K & string>}`]Rename keys`${A}:${B}`Template literal typeT & { __brand: "Id" }Branded primitive
tsconfig and CLI
npx tsc --noEmitType check onlynpx tsc -b --incrementalBuild project referencesnpx tsc --extendedDiagnosticsWhere compile time goes"noUncheckedIndexedAccess": trueIndex reads may be undefined"verbatimModuleSyntax": trueRequireimport type"erasableSyntaxOnly": trueOnly strippable syntaxnode app.tsNode 24 strips types and runs