CodeZettaInterview Hub

TypeScript · Type Inference · Fresh / Intern · Concept

How does contextual typing work?

Short Interview Answer

TS infers types from location — e.g. callback args from parameter types of a function.

Detailed Explanation

Lets you omit annotations safely. Breaks when context is lost (extracted functions).

Did you know this answer?