Arithmetic operators
In this first introduction to operators, we’ll introduce the operators you are most likely familiar with: arithmetic operators with two operands. Those operators assume the operands are both numbers.
+ performs an arithmetic sum:
1 + 2 //3Then we have the subtraction operator (-)
4 - 2 //2The multiplication operator *:
4 * 2 //8The division operator /:
4 / 2 //2And the remainder operator:
4 % 2 //0Last updated
Was this helpful?