6-11. 단계 쪼개기
적용 시점
절차
예시
❌Before
const priceOrder = (product, quantity, shippingMethod) => {
const basePrice = product.basePrice * quantity;
const discount = Math.max(quantity - product.discountThreshold, 0
* product.basePrice * product.discountRate;
const shppingPerCost = (basePrice > shippingMethod.discountThreshold)
? shippingMethod.discountedFee : shippingMethod.feePerCase;
const price = basePrice - discount + shippingCost;
return price;
}⭕After
Last updated