Skip to content

Jawad A.#15

Open
jivvyjams wants to merge 1 commit intoHackYourAssignment:mainfrom
jivvyjams:main
Open

Jawad A.#15
jivvyjams wants to merge 1 commit intoHackYourAssignment:mainfrom
jivvyjams:main

Conversation

@jivvyjams
Copy link

No description provided.

@github-actions
Copy link

github-actions bot commented Feb 4, 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

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

@mo92othman mo92othman left a comment

Choose a reason for hiding this comment

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

Hey @jivvyjams , thanks for the submission 👍
Good job! The overall structure is clear!

Your code still doesn't work for a few small reasons. I left a few comments. Let me know if something is not clear!

Comment on lines +28 to 30
export function getBalance() {
return getTotalIncome() - getTotalExpenses();
}

Choose a reason for hiding this comment

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

There is a logic issue in getBalance

getTotalIncome and getTotalExpenses require transactions,
but they are called here without passing any arguments.

export function printSummary(transactions) {
const totalIncome = getTotalIncome(transactions);
const totalExpenses = getTotalExpenses(transactions);
const balance = getBalance(transactions);

Choose a reason for hiding this comment

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

Because getBalance does not accept parameters, the balance calculation here will not be correct.

@@ -1,3 +1,14 @@
// This is the entrypoint for your application.
// node app.js
import { transactions } from './data.js';

Choose a reason for hiding this comment

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

This import here will not work because of the module styles: CommonJS. Check my comment on the package.json file.

"keywords": [],
"author": "",
"license": "ISC",
"type": "commonjs",

Choose a reason for hiding this comment

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

You mix two module styles: CommonJS and ES modules. If you use commonjs you need to use require.

Or you can enable ES modules ("type": "module"), and then also imports must match how values are exported.

For example, in data.js, which uses a default export, it should be imported without curly braces:
import transactions from './data.js';

},
];

export default transactions;

Choose a reason for hiding this comment

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

data.js uses a default export, so it should be imported without {}.

Comment on lines +2 to +11
import {
addTransaction,
getTotalIncome,
getTotalExpenses,
getBalance,
getTransactionsByCategory,
getLargestExpense,
printAllTransactions,
printSummary,
} from './finance.js';

Choose a reason for hiding this comment

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

Small suggestion 🙂

Some imported functions are not used in this file.
It’s best practice to remove unused imports to keep the code clean and easier to read.

@mo92othman mo92othman added Reviewed This assignment has been reivewed by a mentor and a feedback has been provided and removed To review labels Feb 10, 2026
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