I am trying to select an object array of nested object inside an array of o
export interface IDetails{
_id?: string;
order?: number;
detaildesc?: string;
}
resl:any[];
var data={
locations: string;
id: string;
ordermain: number;
value: string;
details :[IDetails]
}
I am trying to get list of all "order" under details:
resl = this.data.forEach(a=> { a.details.map(x=>x.order});
I'm getting the following error:
type void is not assignable to type any[] for
resl.
When I just make var resl, i get undefined error.
Please let me know how to fix that so I get array of details.order
I checked around on the stackoverflow for possible solution couldnt find one that solves the issue.
Thanks
let result = this.data.details.map(row=> { row.order});