Find the substitution bug in this implementation, whose interface promises a discount for every valid order.
JavaScript
class VipOnlyDiscount {
discountFor(order) {
if (order.customerKind !== 'vip') {
throw new Error('VIP customers only');
}
return order.subtotal * 0.1;
}
}