-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/검색창 기수별 정렬순서 수정 #892 #898
The head ref may contain hidden characters: "feature/\uAC80\uC0C9\uCC3D_\uAE30\uC218\uBCC4_\uC815\uB82C\uC21C\uC11C_\uC218\uC815_#892"
Conversation
const sortedOptions = options.sort((a, b) => { | ||
const aGroup = parseFloat(a.group); | ||
const bGroup = parseFloat(b.group); | ||
if (aGroup !== bGroup) { | ||
return aGroup - bGroup; | ||
} | ||
return a.label.localeCompare(b.label); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const sortedOptions = options.sort((a, b) => { | |
const aGroup = parseFloat(a.group); | |
const bGroup = parseFloat(b.group); | |
if (aGroup !== bGroup) { | |
return aGroup - bGroup; | |
} | |
return a.label.localeCompare(b.label); | |
}); | |
const sortedOptions = options.sort( | |
(a, b) => parseFloat(a.group) - parseFloat(b.group) || a.label.localeCompare(b.label), | |
); |
단축 평가 활용하면 더 간결하게 작성 가능할 것 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 넵 고쳐보겠습니당!
const sortedOptions = options.sort((a, b) => { | ||
const aGroup = parseFloat(a.group); | ||
const bGroup = parseFloat(b.group); | ||
if (aGroup !== bGroup) { | ||
return aGroup - bGroup; | ||
} | ||
return a.label.localeCompare(b.label); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const sortedOptions = options.sort((a, b) => { | |
const aGroup = parseFloat(a.group); | |
const bGroup = parseFloat(b.group); | |
if (aGroup !== bGroup) { | |
return aGroup - bGroup; | |
} | |
return a.label.localeCompare(b.label); | |
}); | |
const sortedOptions = options.sort( | |
(a, b) => parseFloat(a.group) - parseFloat(b.group) || a.label.localeCompare(b.label), | |
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
늦어서 죄송합니다😅😅 수정 완료했습니다!
- 정렬 로직을 단축 평가를 활용하여 단순화 하였습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 수고하셨습니다!
연관 이슈
작업 요약
작업 상세 설명
리뷰 요구사항
Preview 이미지