Skip to content

Commit 55571b5

Browse files
changed the function to use an array method
1 parent b1aa75d commit 55571b5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Sprint-2/debug/recipe.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ const recipe = {
1212

1313
console.log(`${recipe.title}, serves ${recipe.serves}, ingredients:`);
1414

15-
for (const ingredient of recipe.ingredients) {
16-
console.log(ingredient);
17-
}
15+
recipe.ingredients.forEach((ingredient) => console.log(ingredient));

0 commit comments

Comments
 (0)