TypeScript | Advanced Types in TypeScript | Question6

Last Updated :
Discuss
Comments

What does the following template literal type produce?

TypeScript
type Status = "loading" | "success" | "error";
type StatusMessage = `Status: ${Status}`;


A union of string literals prefixed with "Status.

A dynamic string generator.

A type for objects with a Status property.

A function type for status messages.

Share your thoughts in the comments