Conversation
📝 HackYourFuture auto gradeAssignment Score: 0 / 100 ✅Status: ✅ Passed Test Details |
sycons
left a comment
There was a problem hiding this comment.
Following were implemented:
- Setup & configure project ✅
- Create a transactions array ✅
- Implement required functions ✅
- Implement display requirements ✅
- Display summary report ✅
- Code quality ✅
Great job in your implementation ⭐
You've used javascript well. Your app has good structure (use of modules) and has no outdated comments.
Minor feedback regarding using module.exports. Besides that well done.
| }, | ||
| ]; | ||
|
|
||
| module.exports = transactions; |
There was a problem hiding this comment.
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
| const transactions = require('./data'); | ||
| const chalk = require('chalk'); | ||
|
|
||
| function addTransaction(newTransaction) { |
There was a problem hiding this comment.
Good descriptive name for the parameter. This increases readability ⭐
|
|
||
| function getLargestExpense() { | ||
| // TODO: Implement this function | ||
| let largest = { amount: 0, description: 'None' }; |
There was a problem hiding this comment.
Good way to make your function fail safe ⭐
| const categoryStyled = chalk.yellow(category); | ||
|
|
||
| console.log( | ||
| `${index + 1}. ${label} ${description} - €${amount} (${categoryStyled})` |
There was a problem hiding this comment.
Visually it's good to display the amount in green as well. Currently you've only displayed the type in green. Since this is a finance tracker app, it's helpful to highlight the amounts.
| console.log(chalk.bold.yellow('\n💰 PERSONAL FINANCE TRACKER 💰')); | ||
| console.log('\nAll Transactions:'); | ||
|
|
||
| transactions.forEach((t, index) => { |
There was a problem hiding this comment.
Good use of foreach and accessing the index in the callback function parameter. ⭐
No description provided.