The value of the js object cannot be changed

if (type= "cut") {

    if(cartData[index].counts>1){
        console.log("fk");
        cartData[index].counts-=count;
    }
    console.log(count);
    console.log(cartData[index].counts);
    
}
console.log(cartData);

clipboard.png

it turns out that if it is 2, you can"t subtract 1 or 2

.
Feb.27,2022

if (type= "cut") this and single =, change to =

Menu