forked from HackYourFuture/JavaScript1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeRecipeCard.js
More file actions
36 lines (31 loc) · 827 Bytes
/
theRecipeCard.js
File metadata and controls
36 lines (31 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
let myMenemen = {
title: 'Menemen',
servings: 4,
ingredients: [
'8 eggs',
'6 medium/large tomatoes, peeled and chopped into small chunks',
'6 long green peppers cut into small chunks',
'2 finely sliced white onions',
'Half a cup of olive oil',
'Salt',
'Pepper',
],
};
const myMenemenArray = Object.entries(myMenemen);
for (let i = 0; i < myMenemenArray.length; i++) {
switch (myMenemenArray[i][0]) {
case 'title':
console.log('Meal name: ' + myMenemenArray[i][1]);
break;
case 'servings':
console.log('Serves: ' + myMenemenArray[i][1]);
break;
case 'ingredients':
console.log('Ingredients:');
for (let j = 0; j < myMenemenArray[i][1].length; j++) {
console.log(myMenemenArray[i][1][j]);
}
break;
}
}