Deleting product dateOfClick

my function print products is done, but me function delete products with dateOfClick does not work.

function deletePhone(cartItem) {

    var phoneArray = JSON.parse(localStorage.shoppingCart)
    for (var i = 0; i < phoneArray.length; i++) {
       
        if (phoneArray[i].dateOfClick == dateOfClick) {
            phoneArray.splice(i, 1)
            break;
        }
    }
    printProductsInCart();
}

please someone help me :slight_smile: