Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working function #2399

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Working function #2399

wants to merge 1 commit into from

Conversation

Farrelzum
Copy link

No description provided.

Copy link

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

Choose a reason for hiding this comment

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


Great job on implementing the makeRobotAccountant function! 🎉 Your code meets the task requirements and constraints effectively. The function correctly maintains the call count using a closure, and the overall implementation aligns well with the provided style guidelines.

One small improvement you might consider is adjusting the buzzer counter logic. Currently, the counter is decremented before returning the error message, which means the error message will only appear once. By moving the buzzer-- line after the return 'Bzzz... Error!';, you can ensure the error message is consistently returned for all subsequent calls after the limit is exceeded.

Keep up the great work, and happy coding! 😊

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

Comment on lines +13 to +14
if (buzzer > 2) {
buzzer--;

Choose a reason for hiding this comment

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

The buzzer counter is decremented before returning the error message. This means that the error message will only appear once, and subsequent calls will not trigger the error unless the function is called again. Consider moving the buzzer-- line after the return 'Bzzz... Error!'; statement to ensure the error message is consistently returned after the counter exceeds 2.

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