Start with the array of animals we worked with earlier.
- Write a
getAnimalOutfitfunction that takes in a single animal object as an argument and returns a description of the animal's outfit, like "blue pants and red shirt and white shoes". - Add a
favorite foods(array of strings) property to each animal in the array. - Write a
feedAnimalfunction that takes in a single animal object as an argument and prints out what the animals is eating, e.g. "Zebra is eating grass and leaves and plants."
Bonus Exercises
If you finish early, try one or more of these:
- Randomly pick a different food to display each time the
feedAnimalfunction is called. - Implement a “pretty join” function so it reads "bla, bla, and bla" for the foods.