1const person = {
2 name: 'Arif',
3 age: 22,
4 job: 'we-developer',
5 friendList: ['abir', 'adnan', 'alvi'],
6 companyDetails: {
7 id: 3343,
8 companyName: 'IT solution',
9 salary: 33400,
10 location: 'jahanbarge',
11 }
12}
13const [x, y, z] = person.friendList;
14console.log(x, y, z);
15//Expected output:abir adnan alvi
1let arr = [1, 2, 3, 4, [100, 200, 300], 5, 6, 7];
2
3// nested array destructuring
4const [a, , , , [, b, ,], , , ,] = arr;
5
6console.log(a);
7// expected output "1"
8
9console.log(b);
10// expected output "200"