Skip to content
Discussion options

You must be logged in to vote

The issue with the division part of your calculator might not be obvious from what you've shown. The way you've set it up to divide numbers (result = num1 / num2;) looks right. But, problems can happen if someone tries to divide by zero or because JavaScript sometimes gets a bit tricky with numbers.
Also, make sure the option for division in your calculator matches exactly in both your website's form and the JavaScript code. For example, if the choice for dividing is written as <option value=""divide"">Division in the form, your JavaScript needs to use ""divide"" to know when to do the division. If these don't match up perfectly, the division won't work right.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by eFutureDev
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Discussions around programming languages, open source and software development
6 participants