Skip to content

Commit 7155b0b

Browse files
committed
Reversing changes on main.
1 parent c92876e commit 7155b0b

2 files changed

Lines changed: 6 additions & 31 deletions

File tree

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
const personOne = {
2-
firstName: "Popeye",
2+
name: "Popeye",
33
age: 34,
44
favouriteFood: "Spinach",
55
};
6-
7-
let {firstName, age, favouriteFood} = personOne
6+
87
// Update the parameter to this function to make it work.
98
// Don't change anything else.
10-
function introduceYourself() {
9+
function introduceYourself(___________________________) {
1110
console.log(
12-
`Hello, my name is ${firstName}. I am ${age} years old and my favourite food is ${favouriteFood}.`
11+
`Hello, my name is ${name}. I am ${age} years old and my favourite food is ${favouriteFood}.`
1312
);
1413
}
1514

16-
introduceYourself(personOne);
15+
introduceYourself(personOne);

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

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,4 @@ let hogwarts = [
6969
pet: "Phoenix",
7070
occupation: "Teacher",
7171
},
72-
];
73-
function gryffindorforStudent(){
74-
let allStudents = "";
75-
for(let student of hogwarts){
76-
let {firstName,lastName,house,pet,occupation} = student;
77-
if (house === "Gryffindor"){
78-
allStudents += `${firstName} ${lastName}\n`
79-
}
80-
}
81-
return allStudents;
82-
}
83-
84-
function teacherWithPet(){
85-
let allTeachers = "";
86-
for(const person of hogwarts){
87-
let {firstName, lastName,pet, occupation} = person;
88-
if(occupation === "Teacher" && pet !== null){
89-
allTeachers += `${firstName} ${lastName}\n`;
90-
}
91-
}
92-
return allTeachers;
93-
}
94-
95-
console.log(teacherWithPet(hogwarts))
96-
console.log(gryffindorforStudent(hogwarts))
72+
];

0 commit comments

Comments
 (0)