Skip to content

Commit 5c2b4b5

Browse files
author
JorvanW
committed
update the code and added notes to recipe.js
1 parent bbf0a73 commit 5c2b4b5

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎Sprint-2/debug/recipe.js‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
// Predict and explain first...
2+
/* In the console.log the {recipe} doesn't specify ingredients so it will
3+
show up as undefined. Changing it to {recipe.ingredients} should fix that issue.
4+
To log each ingredient on a new line you can use (.join("\n")) which
5+
separate the code by line */
6+
27

38
// This program should log out the title, how many it serves and the ingredients.
49
// Each ingredient should be logged on a new line
@@ -10,6 +15,7 @@ const recipe = {
1015
ingredients: ["olive oil", "tomatoes", "salt", "pepper"],
1116
};
1217

13-
console.log(`${recipe.title} serves ${recipe.serves}
14-
ingredients:
15-
${recipe}`);
18+
console.log(`${recipe.title}
19+
serves ${recipe.serves}
20+
ingredients:
21+
${recipe.ingredients.join("\n")}`);

0 commit comments

Comments
 (0)