아이디어의 프로토타입 제작을 완료했으며 OOP 원칙을 따르기 위해 기존 파일을 리팩터링해야 합니다. 다음 메서드를 포함하는 DataManager 클래스를 만듭니다.
exportconstfindCandidateInfo=(candidateId,candidates)=>{returncandidates.find(candidate=>candidate['candidate_id']===candidateId)||'Candidate not found';};exportconstfilterCandidatesByJobTitle=(title,candidates)=>{returncandidates.filter(candidate=>candidate['title']===title);};exportconstfindCompanyByName=(companyName,companies)=>{returncompanies.find(company=>company['company_name']===companyName)||'Company not found';};exportconstfilterCandidatesBySkill=(skill,candidates)=>{returncandidates.filter(candidate=>candidate['skills'] && candidate['skills'].includes(skill));};
응답
classDataManager{findCandidateInfo(candidateId,candidates){returncandidates.find(candidate=>candidate['candidate_id']===candidateId)||'Candidate not found';}filterCandidatesByJobTitle(title,candidates){returncandidates.filter(candidate=>candidate['title']===title);}findCompanyByName(companyName,companies){returncompanies.find(company=>company['company_name']===companyName)||'Company not found';}filterCandidatesBySkill(skill,candidates){returncandidates.filter(candidate=>candidate['skills'] && candidate['skills'].includes(skill));}}exportdefaultDataManager;
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-05(UTC)"],[],[]]