Start with the array of animals we worked with earlier.
- Write a
getAnimalOutfit
function 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
feedAnimal
function 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
feedAnimal
function is called. - Implement a “pretty join” function so it reads "bla, bla, and bla" for the foods.