0 of 6 problems solved0%
1 of 6

Name It Once

Type aliases let you assign a reusable name to a type. This makes your code easier to read and keeps it consistent—especially for things like IDs, status flags, or other common patterns. Instead of repeating the same type everywhere, you define it once and reuse it.

Examples

// A union for values with multiple possible forms
type Identifier = string | number;

// A literal union for a fixed set of states
type Status = "pending" | "success" | "error";

Your Task

  1. Define type UserId = string | number.
  2. Define type AccountState = 'new' | 'verified' | 'banned'.
  3. Implement makeTag(id: UserId, state: AccountState): string that returns exactly user:${id}/${state}.