I can't add more than one data to array. I couldn't solve this problem running on basic javascript events.
$(".add-cart").on("click", function () {
let products = []
let name, price
name = "product 1"
price = "200"
products.push({
name: name,
price: price
})
// i will click so many times and result is only one length array
// products
// [{name: 'product 1', price: 200}]
});