My dataset consists of 3 separate arrays.
"areas": {
"default": [
{
"area": "Master Bedroom",
"uuid": "986e3f42-1797-49ae-b060-181a33b9",
"description": "",
"new": [
{
"value": "986e3f42-1797-49ae-b060-181a33b9",
"label": "Master Bedroom",
"selected": false
},
{
"value": "0c7abecb-6078-4718-8537-97a0d8ea",
"label": "Bedroom",
"selected": false
},
{
"value": "95de4e05-a5f4-4d67-bd8b-cb3906c4",
"label": "Powder Room",
"selected": false
},
{
"value": "b4e794b2-7a5f-4567-9422-cb1c67c8",
"label": "Kitchen",
"selected": false
},
{
"value": null,
"label": "Select",
"selected": true
}
]
},
{
"area": "Kitchen",
"uuid": "b4e794b2-7a5f-4567-9422-cb1c67c8",
"description": "",
"new": [
{
"value": "986e3f42-1797-49ae-b060-181a33b9",
"label": "Master Bedroom",
"selected": false
},
{
"value": "0c7abecb-6078-4718-8537-97a0d8ea",
"label": "Bedroom",
"selected": false
},
{
"value": "95de4e05-a5f4-4d67-bd8b-cb3906c4",
"label": "Powder Room",
"selected": false
},
{
"value": "b4e794b2-7a5f-4567-9422-cb1c67c8",
"label": "Kitchen",
"selected": false
},
{
"value": null,
"label": "Select",
"selected": true
}
]
}
],
"new": [
{
"value": "986e3f42-1797-49ae-b060-181a33b9",
"label": "Master Bedroom",
"selected": false
},
{
"value": "b4e794b2-7a5f-4567-9422-cb1c67c8",
"label": "Kitchen",
"selected": false
},
{
"value": null,
"label": "Select",
"selected": true
}
]
}
The default
and new
arrays are nested within the main areas
object. Displaying areas from the default
array is my goal, but I also need to add new areas based on the data/labels in the new
array. The challenge lies in repeating an array that is outside of the current iteration. Any suggestions on a better approach or data structure?