JavaScript Arithmetic Operators
JavaScript Arithmetic Operators are used to compute arithmetic operations on given numeric values.
Arithmetic Operator – Symbol – Example
JavaScript supports the following arithmetic operators.
Arithmetic Operation | Operator Symbol | Example |
---|---|---|
Addition | + | a + b |
Subtraction | – | a - b |
Multiplication | * | a * b |
Division | / | a / b |
Modulus | % | a % b |
Increment | ++ | a++ , ++a |
Decrement | — | a-- , --a |
ADVERTISEMENT
Tutorials
The following JavaScript tutorials cover each of these arithmetic operators in detail.
- JavaScript – Addition Operator
- JavaScript – Subtraction Operator
- JavaScript – Multiplication Operator
- JavaScript – Division Operator
- JavaScript – Modulus Operator
- JavaScript – Increment Operator
- JavaScript – Decrement Operator
Example
In the following example, we take two values, and perform different Arithmetic Operations on these values.
index.html
Conclusion
In this JavaScript Tutorial, we learned about Arithmetic Operators, their syntax, and usage with examples.