What happens when undefined is passed to a function with a default parameter?

  • The default parameter is used
  • An error is thrown
  • The function assigns a default value
  • It takes the value 'undefined'
When 'undefined' is passed, the default parameter is used. Explanation should cover how default parameters handle 'undefined' and when they come into play.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *