Welcome to the 1st Annual Alien Dog Show!
Since this is our first event, we're hiring jr Developers like yourself to make sure things don't go wrong. Let's get started!
-
Since this is an intergalatic event, many of our patrons speak different languages! Assign a function to our our
greeting
variable that takes 3 inputs:greeting
,location
andtime
. Concatanate these values together to form a viable sentence and log it to the console. Don't forget the spaces! -
We have more contestants than anticipated. (We actually don't have a count!) Assign a function to our
contestants
variable that will return the number of entries in our dogs array. -
Oh no! Some of our contestants aren't even dogs! Using the native filter method with our
dogs
array, create an array calledfilterSpecies
that will filter out all of the species that are not dogs! -
For safty purposes, let's create a copy of our array. Using the spread operator, assign a copy of our
filteredSpecies
array to ourdogContestants
variable. -
Now that we have our
dogContestants
array, we need to add aclass
property to each dog object. Using the native map method, add a key ofclass
with the value: - "red" if the dog's weight is between 0 and 10. - "yellow" if the dog's weight is between 11 and 20. - "green" if the dog's weight is 21 or over. -
The votes are in! We have an array of the top dogs in each class Using recursion, copy all of the properties into one object and return that object. If you'd like an idea of our data structure, look in the dogData.js file.
-
For statistical reasons, lets count all of the votes we recieved for our dog and non-dog contestants! Using reduce, find the sum of the votes casted.