I이 너무 많이 닮았에 있기 때문에 재산Angular1/자바 스크립트 - 너 한테 조건을 개선
checkProjectType() {
if (this.projectType.labelKey === 'project_type.rent') {
return 'geographical_area'
} else if (this.projectType.labelKey === 'project_type.buying') {
return 'geographical_area'
} else {
return 'address'
}
}
의 값에 따라 객체 projectType
와 다른 값을 반환의 동일한 속성 labelKey
를 확인이 조건 내가 Lodash 나 ECMAScript 2015를 사용하여 단순화 된 쓰기로 조건을 리팩터링/최적화 한 상태?