Why is this checkout coupon always triggering the default tier?
function resolveDiscountTier(subtotal, promoCode) {
let tier = 'STANDARD';
const isVip = promoCode === 'VIP_HERO';
switch (subtotal) {
case subtotal >= 100 && isVip:
tier = 'PLATINUM';
break;
case subtotal >= 100:
tier = 'GOLD';
break;
case subtotal >= 50:
tier = 'SILVER';
break;
default:
tier = 'BRONZE';
}
return tier;
}
Reply with what is broken and how you would fix it.