I want to loop object result from API, And push it in to array.
historys: any = [];
Loop.
Object.keys(response['orderdetail']).forEach(function(index, key) {
console.log(key, response['orderdetail'][index])
this.historys.push(response['orderdetail'][index]);
});
Look like this.historys is not historys: any = [];,
How to do this.
thisrefers to inthis.historys.push? Where have you definedhistorys?