sajad torkamani
On this page

Before

if (product.price > 100 && product.isInStock() && customer.hasLoyaltyCard()) {
    applySpecialDiscount()
}

After

const isEligbleForDiscount = product.price > 100 && product.isInStock() && customer.hasLoyaltyCard()

if (isEligibleForSpecialDiscount) {
    applySpecialDiscount()
}

Leave a comment

Your email address will not be published. Required fields are marked *