Learn Basic OOP by Building a Shopping Cart - Step 51

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

i edited your post so that the step link can be used. Is your question about step 51 though?

Edit: nevermind. I see you’re talking about a specific Hint.
Yeah, looks like a bug. Please open an issue on github. Information below:

Thank you for helping make FCC better. Bugs can be reported as GitHub Issues. Whenever reporting a bug, please check first that there isn’t already an issue for it and provide as much detail as possible.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.