Answers for "array destructuring by using spread operator from a nested object in javascript"

0

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
Posted by: Guest on September-11-2021

Code answers related to "array destructuring by using spread operator from a nested object in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language