I am trying to assign one array to another
orders = [
{
'id': PROCESSING,
'displayName': 'Processing'
},
{
'id': SHIPPED,
'displayName': 'Shipped'
}
];
cloneOrders = [];
setOrders() {
this.orders.forEach((order: any) => {
this.cloneOrders = order;
});
}
However, when I attempt to access the values of 'cloneOrders' in another function, it returns an empty array
getOrders(status, minutes) {
this.cloneOrders .forEach((order: any) => {
console.log(order);
});
}
Both functions exist in the same component. Can someone please assist me with resolving this issue? Thank you.