Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

forEach is not a function error

$
0
0

@MOHANTHANGARAJ wrote:

this.cart = this.aggregateCart(‘cart’);

aggregateCart = (cart) => {
let newCart = ;
cart.forEach(function(item) {
if(newCart.indexOf(item) < 0) {
newCart.push(item);
}
});
return newCart;
}
i have initialized this in constructor and i intend to use this function to aggregate my cart elements but the error is shown like this “”

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>