-
Notifications
You must be signed in to change notification settings - Fork 99
[정기적 문제 풀이 추가 PR] 2022.04.12 #25
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
Conversation
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.
주석을 정말 꼼꼼히 달아주셔서 재미있게 읽었습니다! 제가 한 코멘트는 반영하실 필요는 없고 참고만 해주시면 감사하겠습니다!! 고생하셨습니다 👍
// a 이전 모든 달의 일 수를 더한다 | ||
for(let i = 0, len = a - 1; i < len; i++) { | ||
totalDays += daysOfMonth[i]; | ||
} |
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.
60-64 라인을 const totalDays = daysOfMonth.slice(0, a-1).reduce((acc, curr) => acc + curr, 4)
와 같이 명령형이 아닌 선언형으로 해보시는 것도 좋을 것이라 생각합니다!
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.
다음에 참고해서 멋진 코드 짜보겠습니다 :D
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.
아닙니다 제 코드는 엉망인걸요 ㅠㅠ 이미 멋진 코드를 짜고 계십니다 👍
if(s.length === 4 || s.length === 6) { | ||
for(let i = 0, len = s.length; i < len; i++) { | ||
// 숫자로만 구성돼있는지 확인 | ||
if(!Number.isInteger(parseInt(s[i], 10))) return false; |
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.
29번 조건분이 isNaN
함수로 대체 될 수 있을 것으로 생각됩니다!
https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/isNaN
Update 19문제