We'll get some practice in with the new tools we've picked up with ES6!
- Fork and Clone
- Put your answers to the questions in this readme in the
solutions.js
file
- Define two arrays, evens and odds filled with even and odd numbers.
- Using the spread operator, make a new array numbers that contains all of the evens and odds.
- Define an object faveFoods that has keys representing three of your favorite foods and the values should be the restaurant or locale where they are from.
- Now make another object and do the same thing but this time ask your neighbor what their three favorite foods are. Literally. Go next door and ask them (jk that might not be safe, just pretend you know your neighbor - her name is Janet. very kind. lets you know that it is your other neighbor that is the smoker, not her. ok, Janet, we believe you.).
- Using the spread operator, build a final object allFoods with the items from faveFoods and janetFaveFoods together.
- Define yourself in a javascript Object with three keys: name, age, and hometown.
- Use the destructuring syntax to extract all three keys into variables. Log all three variables.
- Now we are going to give you a pet. Use destructuring to do the following: 1) add a pet object to your person, 2) define three variables (age, breed, name) outside of the object and 3) add those variables to your pet.
- Log the most important thing about you: your pet's name.