We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 59f3869 commit 798da30Copy full SHA for 798da30
Sprint-1/destructuring/exercise-2/exercise.js
@@ -70,3 +70,17 @@ let hogwarts = [
70
occupation: "Teacher",
71
},
72
];
73
+
74
+// Task 1: Display names of people in Gryffindor house
75
+hogwarts.forEach(({ firstName, lastName, house }) => {
76
+ if (house === "Gryffindor") {
77
+ console.log(`${firstName} ${lastName}`);
78
+ }
79
+});
80
81
+// Task 2: Display names of teachers with pets
82
+hogwarts.forEach(({ firstName, lastName, occupation, pet }) => {
83
+ if (occupation === "Teacher" && pet) {
84
85
86
0 commit comments