Beginner
Narrow with typeof
describe takes a string | number | null. For text it returns the text in capital letters, for a number it returns the number with two decimals (toFixed(2)), and for null it returns "nothing".
The starter treats every value as text, which TypeScript rejects. Use typeof checks and early returns so each branch only uses what is valid for it.
What Check tests
- Your code has no type errors
- The console prints
HELLO,3.14andnothing - A boolean is still rejected
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.