Skip to content

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