Command Palette

Search for a command to run...

Hectal
Phase 0: Start Here: Why TypeScript
TypeScript · Exercise 2 of 5 PreviousNext
Beginner

Annotate a Parameter

Strict mode reports the parameter word because it has no type. Add a type annotation so shout only accepts text.

The checks also try shout(5) and expect TypeScript to reject it.

What Check tests

  1. Your code has no type errors
  2. shout(5) is rejected by TypeScript
  3. The console prints HELLO!

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.