Tell us what’s happening:
this absolutely does not make sense. You should call the .toFixed() method on the tax variable, passing 2 as the argument. We have already used the toFIxed method in the calculateTaxes function so why do we need to do this again ? we would already be getting two digits for that right ?
Your code so far
<!-- file: index.html -->
/* file: styles.css */
/* file: script.js */
// User Editable Region
calculateTotal() {
const subTotal = this.items.reduce((total, item) => total + item.price, 0);
const tax = this.calculateTaxes(subTotal);
this.total = subTotal + tax;
cartSubTotal.textContent = `$${subTotal.toFixed(2)}`;
cartTaxes.textContent = `$${tax}`;
cartTotal.textContent =`$${total}`;
}
// 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/128.0.0.0 Safari/537.36
Challenge Information:
Learn Basic OOP by Building a Shopping Cart - Step 51