Skip to content

resolve #128-mark-and-toys 문제풀이 및 문서추가 #129

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
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

heeveloper
Copy link
Collaborator

No description provided.

@heeveloper heeveloper requested review from bumkeyy and yeonjuan August 10, 2019 08:29
Copy link
Owner

@yeonjuan yeonjuan left a comment

Choose a reason for hiding this comment

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

.

const sorted = prices.sort(ascendingCompare);
let sumPrice = 0;

for (const idx in sorted) {
Copy link
Owner

Choose a reason for hiding this comment

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

Array 에서 in  을 사용한 이유가 있나요.

Copy link
Owner

@yeonjuan yeonjuan Aug 10, 2019

Choose a reason for hiding this comment

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

https://stackoverflow.com/questions/500504/why-is-using-for-in-with-array-iteration-a-bad-idea
array 에 대한 in 사용은 오용을 이르킬 가능성이 많습니다...
이를 대체할수 있는 함수가 많습니다 every, some 과 같은..

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in 외에 인덱스값을 사용할 수 있는 방법이 있나요?

Copy link
Owner

Choose a reason for hiding this comment

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

forEach가 있습니다.

Copy link
Owner

Choose a reason for hiding this comment

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

그냥 for 문도 있씁니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants