Command Palette

Search for a command to run...

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

Fix the Price Bug Where the Data Enters

addTax correctly promises a number, but fromInput is text from a form field. Make the program type-check and print 118.

Don't change addTax, and don't use as or any to silence the error: convert the value instead.

What Check tests

  1. Your code has no type errors
  2. The console prints 118
  3. addTax is unchanged
  4. No as or any

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.