logo
Search
showing results for - "array destructuring by using spread operator from a nested object in javascript"
Chiara
22 Aug 2019
1const person = {
2    name: 'labib',
3    age: 22,
4    job: 'web-developer',
5    frieds: ['ahsik', 'abir', 'alvi', 'hanafi'],
6    childList: {
7        firstChild: 'Salman',
8        secondChild: 'Rafi',
9        thirdChild: 'Anfi'
10    }
11}
12const { frieds: [...a] } = person;
13console.log(...a);
14//Expected output:ahsik abir alvi hanafi
similar questions
javascript nested array destructuringnull coalescing on nested object jsdestructuring nested objectshow to destructure complex objectsarray map destructuringjs map nested objectses6 spread assign nested objectes6 parameter destructuring nested objectnested array destructuring javascripthow to destructuring nested object value in javascript 3fspread operator merge objectshow to destructuring values from an nested object in javascript 3fobject destructuring to function parametersdestructuring object from a nested objectdestructuring array and object from a nested objectdestructure object exlude onenested spread operator object
queries leading to this page
destructure object inside array in reactjs using spread operatorarray destructuring by using spread operator from a nested object in javascriptarray destructuring with spreadarray destructuring by using spread operator from a nested object in javascript
privacy policyterms of useinstagram
Crafted with  ♥  for everyone

sign in to continue
your answer for
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
sign in to continue
ask question on maxinterview
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content
please be clear, to the point and respectful
sign in to continue