Skip to content

Commit 5e4611f

Browse files
authored
Display recipe ingredients in the console
Uncommented the loop to display ingredients and removed old console log.
1 parent 013e56d commit 5e4611f

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

‎Sprint-2/debug/recipe.js‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ const recipe = {
1010
ingredients: ["olive oil", "tomatoes", "salt", "pepper"],
1111
};
1212

13-
console.log(`${recipe.title} serves ${recipe.serves}
14-
ingredients:
15-
${recipe}`);
13+
//console.log(`${recipe.title} serves ${recipe.serves}
14+
// ingredients:
15+
//${recipe}`);
16+
17+
for (const ingredient of recipe.ingredients) {
18+
console.log(ingredient);
19+
}
20+
21+
22+
// [object Object] will be shown because JavaScript converts an object to a string, it becomes "[object object].
23+
// Use the syntax to access the ingredients directly

0 commit comments

Comments
 (0)