📜  在javascript代码示例中使用嵌套对象中的扩展运算符进行数组解构

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

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