...

/

Solution Review: Rewriting Function with Better Types

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.

Access this course and 1400+ top-rated courses and projects.