Due to the asynchronous nature of Javascript promises & callbacks are very important.
- Fork this repo
- Clone this repo
Upon completion, run the following commands:
$ git add .
$ git commit -m "done"
$ git push origin master
Create Pull Request so your TAs can check up your work. Write your JavaScript in the provided script.js
file. You'll be calling the addFood()
function from script.js, but do not alter addFood.js.
Notice how the steps to cooking the food are out of order, and all the images are already on the table
** First construct three arrays that place the following steps in the correct order: **
Steak
- Season steak generously with salt, pepper and garlic powder
- Place in ziplock bag
- Cook in sous vide at 120 F for 1-2 hours
- Remove from bag and pat dry
- Heat pan with grapeseed oil and a quarter stick of butter
- Cook steak for 30-60 seconds per side using a spoon to baste with butter
- Rest for 10 mintutes
- Enjoy
Mash Potatoes
- Boil water
- Tear open bag of of instant potato mix and pour into bowl
- Pour in water
- Mix
- Enjoy
Brussel Sprouts
- Wash burussel srouts
- Cut off base and chop in half
- Toss in bowl with olive oil, balsamic vinger and salt
- Preheat oven to 500
- Coat baking sheet with olive oil
- Place in flat side down
- Cook for 20 minutes
- Place back in bowl and add salt and pepper
- Enjoy
Using callbacks print the directions to make Steak in the correct order as shown above. Write your JavaScript in the provided script.js
file. You'll be calling the addFood()
function from script.js, but do not alter addFood.js.
makeFood(steak)
Using promises and the then
statement print the directions to make Mash Potatoes in the correct order
makeFood(mashPotatoes)
Using promises with the async
and await
syntax print the directions to make Brussel Sprouts in the correct order
makeFood(brusselSprouts)
When each food item's steps such as steak
is complete then add that specific food to the #table
div.
Using promise.all
when Steak, Mash Potatoes, and Brussel Sprouts are all finished being made and added to the table, alert Dinner is Served!
All the steps in the correct order