-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathproblem59.js
38 lines (30 loc) · 858 Bytes
/
problem59.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
let instructor = {
name: "Jhankar Mahbub",
entrepreneur: true,
additionalData: {
writer: true,
favoriteHobbies: ["travelling", "Coding"],
books: ["programming er bolod to bos", "programming er coddogosti"],
moreDetails: {
favoriteBasketballTeam: "XYZ",
isYoungest: true,
hometown: {
city: "ABC",
state: "VW",
},
countriesLivedIn: ["Bangladesh", "New York"],
},
},
};
/*
How will you display
- programming er coddogosti
- VW
- Bangladesh
*/
const firstDisplayItem = instructor['additionalData']['books'][1];
console.log(firstDisplayItem);
const secondDisplayItem = instructor.additionalData.moreDetails.hometown.state;
console.log(secondDisplayItem);
const thirdDisplayItem = instructor['additionalData']['moreDetails']['countriesLivedIn'][0];
console.log(thirdDisplayItem);