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
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions level-1/자연수-뒤집어-배열로-만들기&12932&.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,11 @@ function solution(n) {
}
return answer;
}

// 정답 7 - inhwa-jang
function solution(n) {
let str = String(n);
let newArr = Array.from(str);
newArr.reverse();
return newArr.map(Number);
Comment on lines +70 to +73
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
}

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