**JavaScript Arithmetic Operators:** JavaScript Arithmetic Operators includes Addition, Subtraction, Multiplication, Division & Modulus & they are binary operators so they operate on 2 operands.

Read more about **JavaScript Tutorial**.

The below table shows the Arithmetic Operators in JavaScript with examples:

Operator | Description | Example | Results |
---|---|---|---|

+ | Addition | result = x + y | result = 15 |

– | Subtraction | result = x – y | result = 5 |

* | Multiplication | result = x * y | result = 50 |

/ | Division | result = x / y | result = 2 |

% | Modulus | result = x % y | result = 0 |

++ | Increment | result = x++ result = x result = ++x | result = 10 result = 11 result = 12 |

— | Decrement | result = x– result = x result = –x | result = 12 result = 11 result = 10 |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | <!DOCTYPE html> <html> <head> <title>Javascript Arithmetic Operators</title> </head> <body> <h1>Performing Arithmetic Operations </h1> <script> var a = 12, b = 3; var addition, subtraction, multiplication, division, modulus; addition = a + b; //addition of 3 and 12 subtraction = a - b; //subtract 3 from 12 multiplication = a * b; //Multiplying both division = a / b; //dividing 12 by 3 (number of times) modulus = a % b; //calculation the remainder document.write("Addition of " + a +' and ' + b +" is = " + addition + "<br />"); document.write("Subtraction of " + a +' and ' + b +" is = " + subtraction + "<br />"); document.write("Multiplication of " + a +' and ' + b +" is = " + multiplication + "<br />"); document.write("Division of " + a +' and ' + b +" is = " + division + "<br />"); document.write("Modulus of " + a +' and ' + b +" is = " + modulus + "<br />"); </script> </body> </html> |

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

- What is the full form of SDO?
- How do I set a marker in MapView of React Native?
- How to make a button’s corner only rounded on the top?
- Which is better Flutter or React Native?
- How to rotate a Container widget in 2D around a specified anchor point?
- What is the full form of DA?
- How to remove dashboard access from specific user roles?
- List down the collection of methods available on WeakMap
- How do you redirect new page in javascript
- How to break out from a ruby block?
- How to add an admin notice upon post save and update
- What is the easiest multi condition checking
- What are the benefits of using typescript with reactjs?
- Can we define properties for functions
- What is top 5 best linux OS distributions?

We use cookies to ensure that we give you the best experience and use cookies in order to personalize the advertising that you see on our website. Read more about our Privacy Policy.Got it!