Intermediate TypeScript
Q59 / 100

What is the purpose of the "infer" keyword in conditional types?

Correct! Well done.

Incorrect.

The correct answer is B) To extract and capture a type from within another type for reuse

B

Correct Answer

To extract and capture a type from within another type for reuse

Explanation

infer introduces a placeholder type variable that TypeScript fills in by inferring it from the matched type, commonly used to extract return types or array element types.

Progress
59/100