Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
exercise 5
  • Loading branch information
mouzakiskir committed Feb 10, 2020
commit 4c4235aa4bd384ed7227865b4585862a76bc692d
15 changes: 15 additions & 0 deletions Week2/homework/5_wantDrinks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*You're at a party and you feel thirsty! However, you've got 5 friends who are also in need of a drink.
Let's go get them a drink.*/

//Declare a variable that holds an empty array, called drinkTray.
/*There are 3 different types of drinks:
const drinkTypes = ["cola", "lemonade", "water"];*/

//Create a loop that runs 5 times. On each iteration, push a drink into the drinkTray variable.
/*The drinkTray can only hold at most two instances of the same drink type,
for example it can only hold 2 colas, 2 lemonades, 2 waters.*/

/*If there are already two instances of a drinkType then start with the next drink in the array.
Your drinkTray should contain 2 cola, 2 lemonade and 1 water.
Log to the console: "Hey guys, I brought a [INSERT VALUES FROM ARRAY]!"
(For example: "Hey guys, I brought a cola, cola, lemonade, lemonade, water!")*/