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>

OperatorDescription
+Addition
-Subtraction
*Multiplication
**Exponentiation (ES2016)
/Division
%Modulus (Remainder)
++Increment
--Decrement
A typical arithmetic operation takes two numbers and produces a new number.

0 коммент.