'how to reduce value from database by one whenever i click on a button and update to the database

const handleShipped = () =>{
        
        
        
        for(let quantity = parseInt(item.quantity); quantity>0; quantity--){
            console.log(quantity);
        }

    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source