Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

1 / 자연수-뒤집어-배열로-만들기 23b8ededbcc7bc50d3fbc04f457029adc2def830 #114

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

Open
inhwa-jang wants to merge 2 commits into codeisneverodd:main
base: main
Choose a base branch
Loading
from inhwa-jang:patch-1

Conversation

Copy link

@inhwa-jang inhwa-jang commented Oct 19, 2022
edited
Loading

자연수-뒤집어-배열로-만들기&12932&.js 풀이추가

새롭게 추가된 문제 풀이

기존 풀이에 추가한 풀이

function solution(n) {
let str = String(n);
let newArr = Array.from(str);
newArr.reverse();
return newArr.map(Number);
}

관련 이슈

자연수-뒤집어-배열로-만들기&12932&.js 풀이추가
Copy link
Owner

@codeisneverodd codeisneverodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

좋은 코드 잘 보았습니다! 문제되는 부분이 없어 Approve 합니다 😄
앞으로도 많은 기여 부탁드려요!!

Comment on lines +70 to +73
let str = String(n);
let newArr = Array.from(str);
newArr.reverse();
return newArr.map(Number);
Copy link
Owner

@codeisneverodd codeisneverodd Oct 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아래와 같은 메서드 체이닝을 도입해 가독성을 높혀보세요!

Suggested change
let str = String(n);
let newArr = Array.from(str);
newArr.reverse();
return newArr.map(Number);
return Array.from(String(n)).reverse().map(Number);

inhwa-jang reacted with thumbs up emoji
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@codeisneverodd codeisneverodd codeisneverodd approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /