const cart = [ {price: 1000, cnt: 2}, {price: 800, cnt: 3} ]; let sum = 0; for (const {price, cnt} of cart) sum += price * cnt; alert(sum);