// Take in any remaining parameters passed into a function
  // and places them in an array
// JavaScript will NOT tell us if we provided the wrong 
  // number of arguments to a function
// Used if we want to capture all arguments being passed to a function
// The rest parameter must be the last argument in a function definition.
// We can use the rest parameter to grab all remaining arguments.
function smoothie(ingredient1, ingredient2) {
  console.log('My smoothie has ' + ingredient1 + ' and ' + ingredient2);
// smoothie('mango', 'apple');
// We can use rest parameters to make the function more dynamic and 
  // take in any number of arguments.
function restSmoothie(ingredient1, ...otherIngredients) {
  let string = 'My smoothie has ' + ingredient1;
  console.log('\n --- Displaying Rest Parameters: ---')
  console.log(otherIngredients);
  console.log(' --- End Display --- \n')
  otherIngredients.forEach(function (ingredient) {
    string = string + ' and ' + ingredient;
// restSmoothie('mango', 'apple', 'turmeric', 'almond milk');
// ----------------------------------------------------
  // Will spread out elements into the appropriate data structures
  // Will spread iterable data types within function arguments
let smallDogs = ['chihuahua', 'pomeranian', 'maltese'];
let mediumDogs = ['poodle', 'collie', 'basset hound'];
let largeDogs = ['saint bernard', 'great dane', 'english mastiff'];
  // by using the spread operator, we take each element of the array
  // and pass it separately to the new array.
let allDogs = [...smallDogs, ...mediumDogs, ...largeDogs];
// The above is the same as:
// let allDogs = ['chihuahua', 'pomeranian', 'maltese', 'poodle', 'collie', 'basset hound','saint bernard', 'great dane', 'mastiff'];
let onlineInstructors = {
let combinedInstructors = { ...nyInstructors };
combinedInstructors.m = 'Manny';
console.log(combinedInstructors);
console.log(nyInstructors);
// Spread when passing arguments to a function
  // The individual values from the array / object are passed 
    // as arguments to the function
function goodDogs (dog1, dog2, dog3) {
  console.log('A ' + dog1 + ' is a happy dog!');
  console.log('A ' + dog2 + ' is a playful dog!');
  console.log('A ' + dog3 + ' is a sleepy dog!');
// console.log(smallDogs);
// console.log(mediumDogs);
// console.log(largeDogs);