Solution Review: Rewriting Function with Better Types

Look at the solution to the coding challenge of rewriting a function with better types.

We'll cover the following

Solution

By using the type keyword, we create two types for our parameters and ensure that no illegal values can be given as input. Below is the solution code for our challenge.

Get hands-on with 1200+ tech skills courses.