Learn Basic OOP by Building a Shopping Cart - Step 58

Tell us what’s happening:

this code is not passing and i am not sure what i am doing wrong can i get some guidence pls

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

clearCart() {
    if (!this.items.length) {
        alert("Your shopping cart is already empty"); 
        return; 
    }
    
    const isCartCleared = confirm("Are you sure you want to clear all items from your shopping cart?");
    if (isCartCleared) {
        this.items = []; 
        this.total = 0;
    }
        const productsContainer = document.getElementById("productsContainer");
        productsContainer.innerHTML = "";
   }

// 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 58

the productsContainer was created back on line 2 of the js file (so don’t recreate it)

also the new line of code should be placed within the if block