Add Types to a Function's Parameters

Write the code, see it run, pass the checks.

The problem

  • easy
  • Code

Write add(a, b), which returns the sum of two numbers. Give both parameters and the return value the type number, so that calling add with a string is a type error.

Your code must pass

  • Adds two numbers
  • Has no type errors
  • Takes two numbers
  • Returns a number
  • Rejects a string