Looking to flatten a JSON nested array object into a flat array
The key and value pair should be dynamic based on user input array
I attempted to write the code myself but I'm not very familiar with JavaScript functions like concat, push, or others.
Here is the input:
{
"ReportID": "ProfitAndLoss",
"ReportName": "Profit and Loss",
...
}
This is the desired output:
[
{
"ReportID": "ProfitAndLoss",
"ReportName": "Profit and Loss",
...
},
...
]