-
Notifications
You must be signed in to change notification settings - Fork 19
Halyna R. #5
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: main
Are you sure you want to change the base?
Halyna R. #5
Conversation
This comment has been minimized.
This comment has been minimized.
hacdias
left a comment
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.
Hey! In general, very good, and you did all the bonus challenges. So that's quite nice!
I left some minor comments inline. One's a suggestion, one's a question because I think it does affect the output of the question.
finance-tracker/finance.js
Outdated
| let sum = 0; | ||
| for (const transaction of transactions) { | ||
| if (transaction.type === "income") { | ||
| sum = sum + transaction.amount; |
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.
More of a FYI, this can be simplified to:
| sum = sum + transaction.amount; | |
| sum += transaction.amount; |
| */ | ||
| export function findConsecutiveExpensiveMonths(threshold) { | ||
| const groups = groupTransactionsByMonth(); | ||
| const months = Object.keys(groups).sort(); // chronological order |
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.
Chronological order? Or alphabetical? 🤔 That'll definitely affect the output.
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.
Thanks! You’re right — .sort() here sorts the keys alphabetically.
📝 HackYourFuture auto gradeAssignment Score: 0 / 100 ✅Status: ✅ Passed Test Details |
Complete task 4