Advanced TypeScript
Q85 / 100

What is the purpose of template literal types, e.g. "type Greeting = `Hello, ${string}!`"?

Correct! Well done.

Incorrect.

The correct answer is B) They allow constructing string literal types by interpolating other types into a template, enabling pattern-based string types

B

Correct Answer

They allow constructing string literal types by interpolating other types into a template, enabling pattern-based string types

Explanation

Template literal types build new string literal types by combining literals with other types (often unions), useful for things like CSS property names or event names.

Progress
85/100