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

implement calculator #2565

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

galina-palyukh
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.

Great job on implementing the makeCalculator function! 🎉 The code meets the task requirements and constraints effectively. While there's a suggestion to add a type check in the operate method to prevent potential runtime errors, it doesn't impact the core functionality. Keep up the good work, and consider this enhancement for future robustness! 😊

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

Comment on lines +29 to +30
operate(operation, operand) {
operation(operand);

Choose a reason for hiding this comment

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

The operate method should include a check to ensure that the operation argument is a function before attempting to call it. You can do this by adding a condition like if (typeof operation === 'function') to prevent runtime errors when a non-function is passed.

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