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

Fix:"Implement _check" #1 #2147

Closed
wants to merge 1 commit into from
Closed

Fix:"Implement _check" #1 #2147

wants to merge 1 commit into from

Conversation

Piyush-Kumar-Ghosh
Copy link

This PR addresses Issue #1.

src/calculator.js contained duplicate code that checked variable types before performing arithmetic on the variables.

The proposed solution: move the duplicate code to the function exports._check() and do the error-checking by calling this function from within exports.add(), exports.subtract(), exports.multiply(), and exports.divide().

@dantharejabot
Copy link
Collaborator

Thanks for the submission, @Piyush-Kumar-Ghosh.

As mentioned in the contributing guidelines, I can only accept a pull request made to your branch.

This is a weird requirement, but it's necessary here in order to allow multiple people to contribute the same code. In the real world, most projects would expect you to open a Pull Request against the master base branch.

Click here to open this pull request to your branch

Want to contribute to the master branch? Open an issue in the partner repo and let's talk.

@Piyush-Kumar-Ghosh Piyush-Kumar-Ghosh deleted the fix/DRY_issue branch January 2, 2024 13:49
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.

2 participants