Skip to content

Commit 2e088c5

Browse files
committed
Task 1 has been solved
1 parent 14817ee commit 2e088c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sprint-1/destructuring/exercise-2/exercise.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ let hogwarts = [
7171
},
7272
];
7373
function gryffindorHouse(hogwarts){
74-
return hogwarts.filter(({house})=>house==="Gryffindor");
74+
75+
hogwarts.filter(({house})=>house==="Gryffindor")
76+
.forEach(({firstName,lastName})=>
77+
console.log(`${firstName} ${lastName}`))
7578
}
76-
console.log(gryffindorHouse(hogwarts))
77-
//and display the names of the people who belong to the Gryffindor house.
78-
//- Use object destructuring to extract the values you need out of each element in the array.

0 commit comments

Comments
 (0)