📜  javascript 嵌套数组解构 - Javascript 代码示例

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

代码示例1
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