Skip to content

Solution#2449

Open
yuriisychovys-lang wants to merge 2 commits into
mate-academy:masterfrom
yuriisychovys-lang:develop
Open

Solution#2449
yuriisychovys-lang wants to merge 2 commits into
mate-academy:masterfrom
yuriisychovys-lang:develop

Conversation

@yuriisychovys-lang

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

The solution correctly implements the core logic using a closure to maintain the call count, and the functionality works as expected. However, it violates checklist item #2: 'You don't need to name functions if you return them right away.' The function assigned to robotAccountant is declared with a name (function robotAccountant() { ... }) even though it's returned immediately — it should be an anonymous function instead (e.g., return function() { ... };). This is a required checklist violation, not just a style preference, so changes are needed before approval. Fixing this will align the code with the stated standards while preserving all functionality.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/makeRobotAccountant.js Outdated
}
let callCount = 0;

return function getSum(a) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This violates checklist item #2: 'You don't need to name functions if you return them right away.' Since this function is returned immediately, it can be an anonymous function.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

Your implementation of makeRobotAccountant correctly satisfies all functional requirements: the curried function returns the right sums for the first three calls (11, 4, 12), then alternates properly — even calls (4th, 6th, 8th…) return 'Bzzz... Error!', while odd calls (5th, 7th, 9th…) return correct sums (e.g., 71). You’ve used a single callCount variable to track invocations, avoided nested ternary operators, and returned an anonymous arrow function as required [CHECKLIST ITEM #2]. The code is DRY, readable, and fully compliant with the task specification. No critical or blocking issues were found — your solution is approved.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants