TypeScript · Exercise 1 of 5Next
Beginner
Fix the Value, Not the Type
The variable age promises to hold a number, but it was given text. The Types panel shows the error, and the console shows the bug it causes: "12" + 1 is "121".
Fix the value so the code type-checks and prints 13. Keep : number.
What Check tests
- Your code has no type errors
- The console prints
13 agestill promises a number
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.