My objective is to access the 'values' array of the 'model' array separately. However, the 'flatMap' function is not available in my Angular application without adding "esnext" to the tsconfig.json file. I am exploring alternative methods to achieve the same result without using 'flatMap'. Below is my current implementation:
var model= [
{
"values": [
{
"colId": 1,
"value": 7086083333.333333
},
{
"colId": 2,
"value": null
},
],
"rowId": 0,
},
{
"values": [
{
"colId": 1,
"value": null
},
],
"rowId": 1,
"rowHeader": ""
},
{
"values": [
{
"colId": 1,
"value": null
},
{
"colId": 2,
"value": null
},
],
"rowId": 2,
"rowHeader": ""
}
]
const data = model.flatMap((wm) => wm.values);
console.log(data);