Default Parameters
Default Parameters
A default parameter supplies a value when the caller leaves an argument out. This keeps small fallback rules close to the function input.
Your task: Complete greetLearner so it returns "Hello, NAME!". If no name is provided, it should greet "friend". Store and log the result of calling it with no argument.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Default Parameters
A default parameter supplies a value when the caller leaves an argument out. This keeps small fallback rules close to the function input.
Your task: Complete greetLearner so it returns "Hello, NAME!". If no name is provided, it should greet "friend". Store and log the result of calling it with no argument.