Skip to content
TypeScript·Advanced·Conceptual·1 min read

What does infer do in a conditional type?

Short interview answer

It introduces a type variable inferred from the matched structure, allowing helpers to extract parts such as a function's return value or an array element type.

Key takeaway

Explain the underlying mental model clearly, then support it with a concrete example and its trade-offs.

← Back to Generics

Related questions