✏️11.10 명령을 함수로 바꾸기
class ChargeCalculator {
constructor (customer, usage){
this._customer = customer;
this._usage = usage;
}
execute() {
return this._customer.rate * this._usage;
}
}function charge(customer, usage) {
return customer.rate * usage;
}🧷 배경
🧷 절차
🧷 예시
🧷 리팩터링 전
🧷 리팩터링 후
Last updated