var personsInfo = {
company: 'sp-coder',
persons: [{
id: 1,
name: 'Adil',
friedsList: {
friend1: 'Nabil',
friend2: 'Habib'
}
}, {
id: 2,
name: 'Arif',
friedsList: {
friend1: 'alvi',
friend2: 'avi'
}
}]
};
const { friend1, friend2 } = personsInfo.persons[0].friedsList;
console.log(friend1, friend2);
// Expected Output: Nabil Habib