One of the methods I have created is called productsSpecification(), which helps me to showcase some relevant information:
productsSpecification() {
var names = [];
var numbers = [];
this.cart.items.forEach(function(item) {
names += "Item: " + item.product.name + " -";
numbers += " Amount: " + item.quantity + ", ";
});
var together = names + numbers;
return together;
}
My goal is to present the elements in a specific sequence: starting with an element from the 'names' array followed by a corresponding element from the 'numbers' array, such as 'Item: item1 - Amount: 1'
.