Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5819c42

Browse files
committed
Week2 exercises 3 modified
1 parent 0015ef3 commit 5819c42

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Week2/homework/js-exercises/recipe-ex3.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ let recipe = {
44
serves: 2,
55
ingredients : ["2 eggplants", "2 eggs", "1 garlic"]
66
};
7+
let x = ['Meal name', 'Serves', 'Ingredients']
78
//Method1:
89
// for (let property in recipe) {
910
// console.log(property + ": " + recipe[property]);
@@ -20,7 +21,7 @@ let value = Object.values(recipe);
2021

2122
for (let i = 0; i < Object.keys(recipe).length; i++) {
2223

23-
console.log(property[i] + ": " + value[i]);
24+
console.log(x[i] + ": " + value[i]);
2425

2526
};
2627

0 commit comments

Comments
 (0)