Command Palette

Search for a command to run...

Hectal
Phase 5: Arrays, Tuples, Enums and Special Types
TypeScript · Exercise 4 of 6 PreviousNext
Beginner

Check a Table Without Forgetting It

colors is annotated with Palette, so TypeScript only knows each value is string | number[] and the code that calls .map and .toUpperCase fails.

Use satisfies Palette instead of the annotation. The table is still checked against Palette, but each property keeps its exact type.

What Check tests

  1. Your code has no type errors
  2. green is known to be a string
  3. The code uses satisfies
  4. The console prints 1,0,0 #00FF00

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Console

Nothing printed yet.