✏️11.9 함수를 명령으로 바꾸기
function score(candidate, medicalExam, scoringGuide) {
let result = 0;
let healthLevel = 0;
// 긴 코드 생략
}class Scorer {
constructor(candidate, medicalExam, scoringGuide) {
this._candidate = candidate;
this._medicalExam = medicalExam;
this._scoringGuide = scoringGuide;
}
execute() {
this._result = 0;
this._healthLevel = 0;
// 긴 코드 생략
}
}🧷 배경
🧷 절차
🧷 예시
🧷 리팩터링 전
🧷 리팩터링 후
Last updated