Skip to Content
TypeScript for Beginners: Catch Wrong Data Before It Runs
Beginner
0 likes
Courses
TypeScript for Beginners: Catch Wrong Data Before It Runs

Check Yourself: Functions That State Their Deal

Five scenario questions on parameter types, return types and defaults. If you miss more than one, go back to the two lessons before moving on.

Course content

Sign in to save your progress.

Course Home
1. You write function add(a, b) { return a + b; } in a strict project and get Parameter a implicitly has an any type. What is the right fix?
3. A function does rate = rate || 0.12; and a customer has a rate of 0. The tax is calculated as if the rate were 0.12. What is the cleaner fix?

About

Five scenario questions on parameter types, return types and defaults. If you miss more than one, go back to the two lessons before moving on.

Duration
5 min
Last update
10/16/2026
Was this helpful?
​ 0 ​ 0

Comments (0)

Sign in to comment

No comments yet.