Skip to content

Comments

Baraah A.#2

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

Baraah A.#2
thebaraah wants to merge 1 commit intoHackYourAssignment:mainfrom
thebaraah:main

Conversation

@thebaraah
Copy link

No description provided.

@github-actions
Copy link

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

@sycons sycons self-assigned this Feb 8, 2026
Copy link

@sycons sycons left a comment

Choose a reason for hiding this comment

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

Following were implemented:

  • Setup & configure project ✅
  • Create a transactions array ✅
  • Implement required functions ✅
  • Implement display requirements ✅
  • Display summary report ✅

You've done a good job in implementing the requirements and using javascript well.

There are some minor improvements that I have left more info in the comments.

  • Use ES Modules way.
  • Remove invalid comments
  • Some code formatting
  • Use additional javascript features like object destructuring

},
];

module.exports = transactions; No newline at end of file
Copy link

Choose a reason for hiding this comment

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

export default transactions; is more common to use than module.exports = transactions

The way you've done it is the older CommonJS Module way. The newer way is to use export which is ES Modules way.

More info on the history: https://www.w3schools.com/nodejs/nodejs_modules_esm.asp



function addTransaction(transaction) {
// TODO: Implement this function
Copy link

Choose a reason for hiding this comment

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

Code clean up: Remove these TODO statements. Now that you have implemented the code, these are not relevant anymore.

}

function printSummary(){
const totalIncome = getTotalIncome();
Copy link

Choose a reason for hiding this comment

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

Formatting: The code inside this function should be indented.

console.log(chalk.bold('All transactions'));

for(const transaction of transactions){
const amountColor = transaction.type === 'income'
Copy link

Choose a reason for hiding this comment

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

One of the requirements is to use object destructuring. How you've implemented it works perfectly fine. This is just an opportunity to try it out and learn more about it.

More info: https://javascript.info/destructuring-assignment#object-destructuring

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