-
Notifications
You must be signed in to change notification settings - Fork 99
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
Update 문자열-다루기-기본&12918&.js #105
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.
좋은 코드 잘 보았습니다!!
남긴 코멘트는 참고용으로만 보아주세요 😄
level-1/문자열-다루기-기본&12918&.js
Outdated
.includes(NaN); |
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.
NaN 이 있느냐를 확인하시는 것이라면, some
메서드를 사용해보셔도 좋을 것 같아요!
.map((i) => parseInt(i, 10)) | |
.includes(NaN); | |
.some(i => isNaN(parseInt(i, 10))); |
level-1/문자열-다루기-기본&12918&.js
Outdated
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.
early return 방식을 고려해보세요!
사용자(개발자)가 코드를 최소한으로 읽고 이해할 수 있도록, 함수 내에서 특정 조건에 return 이 되도록 되어있다면, 짧은 구문을 위로 올려 return 해보세요! depth 를 줄이고 가독성을 향상시킬 수 있습니다 😄
function solution(s) {
if (s.length !== 4 && s.length !== 6) return false;
return s.split('').some(i => isNaN(parseInt(i, 10)));
}
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.
function solution(s) {
if (s.length !== 4 && s.length !== 6) return false;
return !s.split('').some(i => isNaN(parseInt(i, 10)));
}
정답은 이렇게 되면 제출이 됩니다!
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.
@soulhn 혹시 수정하신 답으로 업로드 하고 싶으시다면, soulhn:soulhn-patch-1 브랜치로 새로운 내용을 push 하여 반영하여주세요!
이렇게 올리는게 맞을까요 fork pr도 처음이였는데 |
@soulhn 네!! 잘 올려주셨습니다 😄 머지합니다! |
새롭게 추가된 문제 풀이
1/ 문자열 다루기 기본 eff3998
기존 풀이에 추가한 풀이
관련 이슈