array destructuring by using spread operator from a nested object in javascript
const person = {
name: 'labib',
age: 22,
job: 'web-developer',
frieds: ['ahsik', 'abir', 'alvi', 'hanafi'],
childList: {
firstChild: 'Salman',
secondChild: 'Rafi',
thirdChild: 'Anfi'
}
}
const { frieds: [...a] } = person;
console.log(...a);
//Expected output:ahsik abir alvi hanafi