Outline

Here's an example of how you could finish this exercise:

// 1. Write a function that prints a welcome message to the console, including the "name" parameter. Provide a default parameter
// Call the function twice, once passing an argument to the function and once without
function welcome(name = 'Friend') {
  console.log('Welcome, ', name);
}
welcome('Preston');
welcome();

// 2. Write a function called "createPizza" that takes a list of named parameters
// Print the different parts of the pizza to the console
function createPizza({ name, price, ingredients }) {
  console.log(name, price, ingredients);
}
createPizza({ name: 'Pepperoni', price: 5, ingredients: ['marinara', 'cheese', 'pepperoni']});

// 3. Write a function called "describeDog" that takes two parameters: name and hobbies
// Print a message with the dogs names and its hobbies
function describeDog(name, ...hobbies) {
  console.log(name, hobbies);
}
describeDog('Duke', 'playing fetch', 'going for walks', 'running');

You can see the answers to this exercise in this StackBlitz Project.

 

I finished! On to the next chapter