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 2ea2b47 commit a28710aCopy full SHA for a28710a
1 file changed
Sprint-1/destructuring/exercise-2/exercise.js
@@ -72,7 +72,7 @@ let hogwarts = [
72
];
73
function getGryffindorStudents(hogwarts) {
74
for (const { firstName, lastName, house } of hogwarts) {
75
- if (house === "Gryffindor") {
+ if (house === "Gryffindor") {
76
console.log(`${firstName} ${lastName}`);
77
}
78
@@ -88,4 +88,12 @@ function getTeachersWithPets(hogwarts) {
88
89
90
91
-getTeachersWithPets(hogwarts);
+getTeachersWithPets(hogwarts);
92
+function getGryffindorStudents(hogwarts) {
93
+ for (const { firstName, lastName, house, occupation } of hogwarts) {
94
+ if (house === "Gryffindor" && occupation === "Student") {
95
+ console.log(`${firstName} ${lastName}`);
96
+ }
97
98
+}
99
+getGryffindorStudents(hogwarts);
0 commit comments