Hey there! I've got this JSON structure that I'm trying to convert into an array without having to iterate over each element. Is there a JavaScript function that can help me achieve this?
{
"ES": {
"130": {
"code": "A Coruсa",
"name": "A Coruña"
},
"131": {
"code": "Alava",
"name": "Alava"
},
"...": {
"code": "...",
"name": "..."
}
},
"CH": {
"104": {
"code": "AG",
"name": "Aargau"
},
"...": {
"code": "...",
"name": "..."
}
},
"...": {
"...": {
"code": "...",
"name": "..."
}
}
}
Here's the desired output:
[
{
"code": "A Coruсa",
"name": "A Coruña"
},
{
"code": "Alava",
"name": "Alava"
},
{
"code": "...",
"name": "..."
},
{
"code": "AG",
"name": "Aargau"
},
{
"code": "...",
"name": "..."
},
{
"code": "...",
"name": "..."
}
]
Appreciate any recommendations or help you can provide. Thank you!