There was an error while loading. Please reload this page.
1 parent 004337d commit b07cf4eCopy full SHA for b07cf4e
1 file changed
Sprint-1/destructuring/exercise-2/exercise.js
@@ -70,3 +70,23 @@ let hogwarts = [
70
occupation: "Teacher",
71
},
72
];
73
+
74
75
+// Task 1: Gryffindor members
76
+hogwarts.forEach((person) => {
77
+ const { firstName, lastName, house } = person;
78
79
+ if (house === "Gryffindor") {
80
+ console.log(`${firstName} ${lastName}`);
81
+ }
82
+});
83
84
85
+// Task 2: Teachers with pets
86
87
+ const { firstName, lastName, occupation, pet } = person;
88
89
+ if (occupation === "Teacher" && pet) {
90
91
92
0 commit comments