-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
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.
.
const sorted = prices.sort(ascendingCompare); | ||
let sumPrice = 0; | ||
|
||
for (const idx in sorted) { |
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.
Array 에서 in 을 사용한 이유가 있나요.
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.
https://stackoverflow.com/questions/500504/why-is-using-for-in-with-array-iteration-a-bad-idea
array 에 대한 in 사용은 오용을 이르킬 가능성이 많습니다...
이를 대체할수 있는 함수가 많습니다 every, some 과 같은..
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.
in 외에 인덱스값을 사용할 수 있는 방법이 있나요?
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.
forEach가 있습니다.
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.
그냥 for 문도 있씁니다.
No description provided.