Skip to content

Commit 558e0a8

Browse files
committed
Update the array data provided in the exercises to contain objects
1 parent f683bf2 commit 558e0a8

File tree

4 files changed

+18
-21
lines changed

4 files changed

+18
-21
lines changed

week-3/Homework/mandatory/2-exercises/exercise-1/exercise-1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let person = {
88
lastName: "Wayne"
99
}
1010
11-
let { firstName, lastName} = person;
11+
let { firstName, lastName } = person;
1212
1313
console.log(`Batman is ${firstName}, ${lastName}`);
1414
```
Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
let hogwarts = [
2-
['Harry', 'Potter', 'Gryffindor', 'Owl', 'Student'],
3-
['Hermione', 'Granger', 'Gryffindor', 'Cat', 'Student'],
4-
['Draco', 'Malfoy', 'Slytherin', 'None', 'Student'],
5-
['Cedric', 'Diggory', 'HufflePuff', 'None', 'Student'],
6-
['Severus', 'Snape', 'Slytherin', 'None', 'Teacher'],
7-
['Filius', 'Flitwick', 'Ravenclaw', 'None', 'Teacher'],
8-
['Pomona', 'Sprout', 'Hufflepuff', 'None', 'Teacher'],
9-
['Minerva', 'McGonagall', 'Gryffindor', 'None', 'Teacher'],
10-
['Albus', 'Dumbledore', 'Gryffindor', 'Phoenix', 'Teacher']
2+
{ firstName: "Harry", lastName: "Potter", house: "Gryffindor", pet: "Owl", occupation: "Student" },
3+
{ firstName: "Hermione", lastName: "Granger", house: "Gryffindor", pet: "Cat", occupation: "Student" },
4+
{ firstName: "Draco", lastName: "Malfoy", house: "Slytherin", pet: null, occupation: "Student" },
5+
{ firstName: "Cedric", lastName: "Diggory", house: "HufflePuff", pet: null, occupation: "Student" },
6+
{ firstName: "Severus", lastName: "Snape", house: "Slytherin", pet: null, occupation: "Teacher" },
7+
{ firstName: "Filius", lastName: "Flitwick", house: "Ravenclaw", pet: null, occupation: "Teacher" },
8+
{ firstName: "Pomona", lastName: "Sprout", house: "Hufflepuff", pet: null, occupation: "Teacher" },
9+
{ firstName: "Minerva", lastName: "McGonagall", house: "Gryffindor", pet: null, occupation: "Teacher" },
10+
{ firstName: "Albus", lastName: "Dumbledore", house: "Gryffindor", pet: "Phoenix", occupation: "Teacher" }
1111
]
12-

week-3/Homework/mandatory/2-exercises/exercise-2/exercise-2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ For each character you have the following information:
1313

1414
## Task 1
1515

16-
- In `exercise-2.js` write a program that will display the names of the people who belong to the Gryffindor house.
16+
- In `exercise-2.js` write a program that will take the `hogwarts` array as input and display the names of the people who belong to the Gryffindor house.
1717
- Use array destructuring to extract the values you need out of the array.
1818

1919
### Expected result
@@ -28,7 +28,7 @@ Albus Dumbledore
2828

2929
## Task 2
3030

31-
- In `exercise-2.js` write a program that will display the names of teachers who have pets.
31+
- In `exercise-2.js` write a program that will take the `hogwarts` array as input and display the names of teachers who have pets.
3232
- Use array destructuring to extract the values you need out of the array.
3333

3434
### Expected result
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
let order = [
2-
['Hot cakes', 1, 2.29],
3-
['Apple Pie', 2, 1.39],
4-
['Egg McMuffin', 1, 2.80],
5-
['Sausage McMuffin', 1, 3.00],
6-
['Hot Coffee', 2, 1.00],
7-
['Hash Brown', 4, 0.40]
2+
{ itemName: "Hot cakes", quantity: 1, unitPrice: 2.29},
3+
{ itemName: "Apple Pie", quantity: 2, unitPrice: 1.39},
4+
{ itemName: "Egg McMuffin", quantity: 1, unitPrice: 2.80},
5+
{ itemName: "Sausage McMuffin", quantity: 1, unitPrice: 3.00},
6+
{ itemName: "Hot Coffee", quantity: 2, unitPrice: 1.00},
7+
{ itemName: "Hash Brown", quantity: 4, unitPrice: 0.40}
88
]
9-
10-
// Write your code below
119

0 commit comments

Comments
 (0)