JavaScript Arithmetic
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 = 10 + 35;
document.getElementById("demo").innerHTML = x;
</script>
Operator | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
** | Exponentiation (ES2016) |
/ | Division |
% | Modulus (Remainder) |
++ | Increment |
-- | Decrement |
Комментарии
Отправить комментарий