Need help, there is a function
function showMiniCart(){ //показываю содержимое корзины var out =''; for (var key in cart) { out += Object.keys(cart).reduce((total, key) => total += cart[key], 0); } $('#mini-cart').html(out); } The problem is that it doesn’t bring out quite right, that’s what I wanted, namely, the basket will fall: If I add 1 product, everything adds up normally, but when you add 2 products, the result is added and displayed side by side again.
Example: 1 item - output 1, 2 item - output 22, 3 item - displays 333.
var out = 0;(2 characters needed ...) - Igor