Skip to content

Glossary: TypeScript Basics

contextual typing

TypeScript working out a type from where a value is used. In `printTable(2, (n) => ...)`, `n` is a number because `printTable` says its callback takes a number.

Where the book teaches it

Related terms

callbacktype inference