-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Advanced calculator #2922
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
base: master
Are you sure you want to change the base?
Advanced calculator #2922
Conversation
src/makeCalculator.js
Outdated
| return this; | ||
| }, | ||
| operate(callback, number) { | ||
| calculator.result = callback(number); |
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.
result of operation assinged to result 2 times. First time inside arithmetic operation and second time directly from callback return
src/makeCalculator.js
Outdated
| const calculator = { | ||
| result: 0, | ||
| add(number) { | ||
| calculator.result += number; |
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.
fields from parent object should be called using keyword this
Same to all below
Dimononon
left a comment
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.
Almost, need some adjustments)
mateacademy-ai-mentor
left a comment
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.
Review Summary
Excellent work on your calculator implementation! Your solution meets all the functional and style requirements outlined in the task. The code is clean, logical, and demonstrates a strong understanding of the concepts involved. Your use of .call() within the operate method to manage the context of the callback functions is a particularly great solution. I'm happy to approve this submission.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
Dimononon
left a comment
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.
Good job
Solution