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
- Your code has no type errors
greenis known to be a string- The code uses satisfies
- 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.
Press Run to see the page.
Console
Nothing printed yet.