TypeScript · Exercise 1 of 6Next
Beginner
Fix the Implicit any
Strict mode refuses two functions whose parameters have no types. Give every parameter a real type so the file type-checks, and don't use the word any.
average takes a list of numbers. describe takes an object with name (text) and age (number). The console must print 6 and Asha is 30, and average("4,8") must be rejected by TypeScript.
What Check tests
- Your code has no type errors
average("4,8")is rejected by TypeScript- The console prints
6andAsha is 30 - The code does not use the type
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.
Press Run to see the page.
Console
Nothing printed yet.