📜  Javascript代码示例中的嵌套解构

📅  最后修改于: 2022-03-11 15:01:41.756000             🧑  作者: Mango

代码示例3
const person = {
    name: 'Arif',
    age: 22,
    job: 'we-developer',
    friendList: ['abir', 'adnan', 'alvi'],
    companyDetails: {
        id: 3343,
        companyName: 'IT solution',
        salary: 33400,
        location: 'jahanbarge',
    }
}
const [x, y, z] = person.friendList;
console.log(x, y, z);
//Expected output:abir adnan alvi