스터디일지 3

[스터디일지] 23.01.08

1번 - replace-temp-with-query1 if 문 / 삼항 연산자 discountFactor() { const basePrice = this.basePrice(); if (basePrice > 1000) { return 0.95; } else { return 0.98; } } discountFactor() { const basePrice = this.basePrice(); basePrice > 1000 ? 0.95 : 0.98 } 임시변수 discountFactor(파라미터) 2번 - replace-temp-with-query2 아이템 프라이스 코드 차이 //기존 basePrice = this.itemPrice * 2; // basePrice에 두번째 대입 //refactor price() ..

스터디일지 2023.01.14

[개발 스터디] 23.01.01

리팩터링 extract-method1 outstanding을 this.getTotalOutStanding()으로 처리하는 것이 아닌, outstanding을 파라미터로 받아서 결과 출력 public printOwing() { this.printLogText(); this.printCustomerOwe(this.getTotalOutStanding()); } private printCustomerOwe(outstanding: number) { console.log("name : " + this.name); console.log("amount : " + outstanding); } B메서드 구현방법 : for문으로 구현 / reduce로 구현 //reduce private getOutstanding) { re..

스터디일지 2023.01.08

221225 개발 스터디 기록

TDD - describe 분리하는 기준? (sy) 기능 별로 2개이상일 경우 분리 (ex) pop / 예외처리, 기능 구현) (sw) 처음에는 기능별로 묶었으나, 통일성을 위해 모두 descirbe로 묶으면 좋을 것 같다. - 예외처리 누락 되는 경우? (sy) 처음부터 완벽하게 할 수 없을 것 같다. 생각나는 부분, 필요한 부분 부터 하다가 추가하는 게 좋아보인다. - length vs size() (sy, sw) 처음에 length로 함 (sb) 이전 강의에서 내부에서 대부분 함수를 가져다 써저 함수를 만들어서 사용함 - class vs 함수형 vs 배열 (sy) class 형 사용 (sb) 함수형으로 시도했으나 안되어서 class형으로 사용 (sw) 배열 형태로 사용 Mock vs Stub sy)..

스터디일지 2022.12.31