Default Parameters in JavaScript

Easy
29
2
76.0% Acceptance

In this lab, you have to create a function with default parameters using JavaScript. Default parameters in functions are the default values assigned to a parameter when no input is provided. They help in handling the cases when a user doesn't provide certain parameter values to avoid errors and provide a consistent output.

In this lab, you will create a greet function that takes a name and a greeting parameter. The function should return a greeting message when called with values for both parameters or when only the name is provided, using the default value for the greeting parameter.