-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
base: develop
Are you sure you want to change the base?
Solution #2390
Conversation
There was a problem hiding this 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) => { |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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.
return numberOfCalls > 3 && numberOfCalls % 2 === 0 | ||
? `Bzzz... Error!` | ||
: numbersSum; |
There was a problem hiding this comment.
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.
No description provided.