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

advanced calculator done 🎉 #2553

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

Conversation

SofiSolf
Copy link

@SofiSolf SofiSolf commented Jan 8, 2025

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 makeCalculator function! 🎉 Your code meets the task requirements and constraints effectively. The functionality is well-implemented, and the methods are correctly defined. While it's not necessary for this task, you might consider adding a check to ensure the callback in the operate method is a function for added robustness. Keep up the excellent work! 😊

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

Comment on lines +36 to +37
operate(callback, number) {
callback.call(this, number);

Choose a reason for hiding this comment

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

The operate method should not check if the callback is one of the calculator's own methods. It is allowed to check if the callback is a function using typeof callback === 'function'. Consider adding this check to ensure that the callback is a valid function before calling it.

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

2 participants