loading...

re: How to write clean functions VIEW POST

FULL DISCUSSION
 

do you think isValidCoupon is more suitable than applyCouple in your use case?

const isValidCoupon = coupon && coupon.unused && isCouponCompatible(product, coupon);
 

Very good point 👍

Even the other Boolean could be better named to isSaleActive rather than applySale.

I'll make both changes.

code of conduct - report abuse