I have an array of objects below:
const obj = [
0:{
"content": {
"tabs": [
{
"name": "Overview",
"id": 1,
"sections":[
{"event_description":"Event Description"},
{"photos":"Photos"},
{"reference_documents":"Reference Documents"},
{"discussion":"Discussion"}
]
},{...},{..}
]
}
},
1:{}
]
How can I take just the sections array from obj with destructuring?
I've tried these things:
const [{content={}}] = obj;
const [{content{tabs={}}]=obj;
const [{content{tabs[0]{sections}}}]=obj;
And also sections should be changed to another variable name.