javascript-today

Numerical Operators

Operators allow us to use logic on values to get a new value. Addition and Subtraction in math is a common example of an operation.

Common numerical operators: (in reverse order of operation prefrence)

  1. + addition, - subtraction
  2. \ division, * multiplication, % remainder (of division),
  3. ** exponentiation,
  4. = assignment

shorthands: work only with numerical variables not numbers themselves.

++ increment, -- decrement

these can either be before a variable or after but may yield different results depending how they are used.

Next Article: String Operators

Mozilla developer site detail