hello, i have a question about pushing new attributes to an existing data, i tried many methods, but i cannot find the answer yet about it, i push an attribute to an existing data 1 time, but it automatically repeats itself
calculatedeliverycharges() {
this.cart.forEach(element => {
this.temp=element
this.http.get("http://abc,com/api/shippings/calculate/" + element.zipcode + "/" + this.receivercode + "/" + element.quantity).subscribe(res => {
let temp = element
temp['shippingcost'] = res['price']
this.cart.push(element);
console.log('what is updated cart', this.cart);
return this.cart;
})
console.log('calculate delivery charges', this.cart);
});
}
i get the following result,
can anyone enlighten me where have i missed out or went wrong?
why i push 1 time, but it repeated itself ?
thank you very much

