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

everything is completed #2333

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

EvgenLutscenko
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.

The makeCalculator function is well-structured and follows most of the best practices according to the checklist provided. However, there are a few improvements that can be made to align it with the given checklist.

@@ -3,8 +3,35 @@
/**
* @return {object}
*/

// `add`, `subtract`, `multiply`, `divide`, `reset`, `operate`

function makeCalculator() {

Choose a reason for hiding this comment

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

According to the naming convention in the checklist, if a function is named makeCalculator, it should return an object named calculator. Currently, the function returns an object without a specific name. Consider adjusting the code to follow this convention if it's required by your project's guidelines.


return this;
},
operate(operation, val) {

Choose a reason for hiding this comment

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

The operate method can be improved by directly invoking the passed operation on this.result with the provided value instead of using call. This would simplify the implementation and avoid the unnecessary use of this binding, which is not needed as the methods add, subtract, multiply, divide are already using this to refer to the calculator object.

Choose a reason for hiding this comment

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

comment not fixed

Copy link

@VitaliyBondarenko1982 VitaliyBondarenko1982 left a comment

Choose a reason for hiding this comment

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

Good job.
Please fix prev comments.


return this;
},
operate(operation, val) {

Choose a reason for hiding this comment

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

comment not fixed

Copy link

@lerastarynets lerastarynets left a comment

Choose a reason for hiding this comment

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

lgtm 🚀

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.

None yet

4 participants