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 2e088c5 commit 002a1efCopy full SHA for 002a1ef
Sprint-1/destructuring/exercise-2/exercise.js
@@ -70,9 +70,16 @@ let hogwarts = [
70
occupation: "Teacher",
71
},
72
];
73
-function gryffindorHouse(hogwarts){
+function gryffindorHouse(arr){
74
75
- hogwarts.filter(({house})=>house==="Gryffindor")
+ arr.filter(({house})=>house==="Gryffindor")
76
.forEach(({firstName,lastName})=>
77
console.log(`${firstName} ${lastName}`))
78
}
79
+ function teachersHavePet(arr){
80
+ arr.filter(({occupation,pet})=>(occupation==="Teacher" && pet))
81
+ .forEach(({firstName,lastName})=> console.log(`${firstName} ${lastName}`))
82
+ }
83
+ gryffindorHouse(hogwarts);
84
+ console.log("***************************************")
85
+ teachersHavePet(hogwarts);
0 commit comments