Skip to content

Comments

Yana P#8

Open
YanaP1312 wants to merge 6 commits intoHackYourAssignment:mainfrom
YanaP1312:main
Open

Yana P#8
YanaP1312 wants to merge 6 commits intoHackYourAssignment:mainfrom
YanaP1312:main

Conversation

@YanaP1312
Copy link

  1. All required functions for the financial tracker have been implemented.
  2. Repeated logic has been extracted into separate helper functions (for example, expense filtering).
  3. A bonus task function has been added.
  4. A multi‑line comment has been written for the most complex function (findConsecutiveExpensiveMonth).

@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

Copy link

@reposman33 reposman33 left a comment

Choose a reason for hiding this comment

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

looks good, but I don't see (a dependency on) prettier in package.json

"author": "",
"license": "ISC",
"dependencies": {
"chalk": "^4.1.2"

Choose a reason for hiding this comment

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

no prettier for code formatting?

"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node finance-tracker/app.js"

Choose a reason for hiding this comment

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

nice touch to add a script for starting the app

Copy link

@reposman33 reposman33 left a comment

Choose a reason for hiding this comment

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

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))

Choose a reason for hiding this comment

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

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()

Choose a reason for hiding this comment

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

FYI: there is now an Array.toSorted() function that doesn't mutate the array but returns a new sorted array

@reposman33 reposman33 added Reviewed This assignment has been reivewed by a mentor and a feedback has been provided and removed Review in progress labels Feb 23, 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