JavaScript Arithmetic Operators
Arithmetic operators perform arithmetic on numbers (literals or variables).
<p>A typical arithmetic operation takes two numbers and produces a new number.</p>
<p id="demo"></p>
<script>
var x = 121 + 29;
document.getElementById("demo").innerHTML = x;
</script>
Operator | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
** | Exponentiation (ES2016) |
/ | Division |
% | Modulus (Remainder) |
++ | Increment |
-- | Decrement |
0 коммент.