Conversation
YanaP1312
commented
Feb 4, 2026
- All required functions for the financial tracker have been implemented.
- Repeated logic has been extracted into separate helper functions (for example, expense filtering).
- A bonus task function has been added.
- A multi‑line comment has been written for the most complex function (findConsecutiveExpensiveMonth).
📝 HackYourFuture auto gradeAssignment Score: 0 / 100 ✅Status: ✅ Passed Test Details |
reposman33
left a comment
There was a problem hiding this comment.
looks good, but I don't see (a dependency on) prettier in package.json
| "author": "", | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "chalk": "^4.1.2" |
| "main": "index.js", | ||
| "scripts": { | ||
| "test": "echo \"Error: no test specified\" && exit 1", | ||
| "start": "node finance-tracker/app.js" |
There was a problem hiding this comment.
nice touch to add a script for starting the app
reposman33
left a comment
There was a problem hiding this comment.
looks good, 2 comments on the new (2023) toSorted() function and a performance optimization tip
| const largestExpense = getLargestExpense(transactions); | ||
| const largestExpenseForm = chalk.bold(largestExpense.amount); | ||
| const largestExpenseDescr = getFirstCharacterToUp(largestExpense.description); | ||
| ? chalk.bold.cyan(getBalance(transactions)) |
There was a problem hiding this comment.
you execute 3 times the same function getBalance(transactions), which is 2 times too much. Better is to store the value of getBalance(transactions) in a variable and then use that variable to check if its value > 0 and then passing it to chalk.bold.cyan() or chalk.bold.red()
|
|
||
| export function searchTransactionsByDate(transactions, startDate, endDate) { | ||
| const sorted = transactions | ||
| .slice() |
There was a problem hiding this comment.
FYI: there is now an Array.toSorted() function that doesn't mutate the array but returns a new sorted array