I am not sure why this step is not working please can someone help
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
addItem(id, products) {
const product = products.find((item) => item.id === id);
if (product) {
// Add product to the cart
this.items.push(product);
// Increment the count of this product in the cart
this.totalCountPerProduct[product.id] = (this.totalCountPerProduct[product.id] || 0) + 1;
let currentProductCount = this.totalCountPerProduct[product.id]
}
}
// User Editable Region
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36
Challenge Information:
Learn Basic OOP by Building a Shopping Cart - Step 25
Being able to talk about code is a critical job ready skill and you cannot find work as a programmer without it, but its a hard skill that requires practice. Without trying to talk about code, you really are holding your own learning back.
Something like “I created this variable here that the instructions were talking about, and tried to set it to the value they requested, but it doesn’t seem to be correct” would be a great place to start.