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

Solution #2390

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Solution #2390

wants to merge 2 commits into from

Conversation

mgsorigo
Copy link

@mgsorigo mgsorigo commented Nov 6, 2024

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! 🎉 Your implementation of the makeRobotAccountant function meets all the task requirements and constraints. The logic for tracking calls and returning the correct sum or error message is spot on. Keep up the excellent work! If you have any questions or need further clarification, feel free to ask. 😊

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

// write code here
let numberOfCalls = 0;

return (numberOne = 0) => {

Choose a reason for hiding this comment

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

The default parameter numberOne = 0 is correctly used here. However, ensure that this behavior is intended, as it will default to 0 if no argument is provided.

let numberOfCalls = 0;

return (numberOne = 0) => {
return (numberTwo = 0) => {

Choose a reason for hiding this comment

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

The default parameter numberTwo = 0 is correctly used here. Ensure this is the intended behavior, as it will default to 0 if no argument is provided.

Comment on lines +17 to +19
return numberOfCalls > 3 && numberOfCalls % 2 === 0
? `Bzzz... Error!`
: numbersSum;

Choose a reason for hiding this comment

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

The condition numberOfCalls > 3 && numberOfCalls % 2 === 0 is used to determine when to return an error message. Verify that this logic aligns with the task requirements, as it will trigger an error on every even call after the third call.

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.

3 participants