1var personsInfo = {
2 company: 'sp-coder',
3 persons: [{
4 id: 1,
5 name: 'Adil',
6 friedsList: {
7 friend1: 'Nabil',
8 friend2: 'Habib'
9 }
10 }, {
11 id: 2,
12 name: 'Arif',
13 friedsList: {
14 friend1: 'alvi',
15 friend2: 'avi'
16 }
17 }]
18};
19
20const { friend1, friend2 } = personsInfo.persons[0].friedsList;
21console.log(friend1, friend2);
22// Expected Output: Nabil Habib
1const user = { id: 339, name: 'Fred', age: 42};
2const {name} = user;
3console.log(name); //Expected output: fred