Skip to content

Conversation

@halyna1995
Copy link

Complete task 4

@github-actions

This comment has been minimized.

@hacdias hacdias self-assigned this Feb 5, 2026
Copy link

@hacdias hacdias left a 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.

let sum = 0;
for (const transaction of transactions) {
if (transaction.type === "income") {
sum = sum + transaction.amount;
Copy link

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:

Suggested change
sum = sum + transaction.amount;
sum += transaction.amount;

*/
export function findConsecutiveExpensiveMonths(threshold) {
const groups = groupTransactionsByMonth();
const months = Object.keys(groups).sort(); // chronological order
Copy link

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.

Copy link
Author

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.

@hacdias hacdias added Reviewed This assignment has been reivewed by a mentor and a feedback has been provided and removed To review labels Feb 8, 2026
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

📝 HackYourFuture auto grade

Assignment Score: 0 / 100 ✅

Status: ✅ Passed
Minimum score to pass: 0
🧪 The auto grade is experimental and still being improved

Test Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed This assignment has been reivewed by a mentor and a feedback has been provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants