Tell us what’s happening:
I don’t know how to do what the test keeps telling me to do:
You should assign the value of your cart
object’s .getCounts()
method to the textContent
property of the totalNumberOfItems
variable.
Please help.
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
[...addToCartBtns].forEach(
(btn) => {
btn.addEventListener("click", (event) => {
cart.addItem(Number(event.target.id), products);
cart.getCounts() = totalNumberOfItems.textContent
})
}
);
// 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/134.0.0.0 Safari/537.36
Challenge Information:
Build a Shopping Cart - Step 42