Important Arithmetic Operators

Important Arithmetic Operators in javascript

Symbol Name Description Example
++ Increment
  • variable++ : 1 is added to the variable value and the result is stored in the same variable, also the original value(before incrementing) is returned.
  • ++variable : 1 is added to the variable value and the result is stored in the same variable, also the stored value is returned.
Try Yourself
-- Decrement
  • variable-- : 1 is subtracted from the variable value and the result is stored in the same variable, also the original value(value before decrementing) is returned.
  • --variable : 1 is subtracted from the variable value and the result is stored in the same variable, also the stored value is returned.
Try Yourself
** Exponentiation It perform arithmetic power operation. Try Yourself
% Remainder It is used to get the remainder from the division operation. Try Yourself
+value Unary plus It tries to convert the given value into integer value. If it can't be converted NaN will be returned. Try Yourself
-value Unary negation It tries to convert the given value into negative value. If it can't be converted NaN will be returned. Try Yourself

Increment operator in javascript

Example

Try Yourself

Decrement operator in javascript

Example

Try Yourself

Exponentiation operator in javascript

Example

Try Yourself

Remainder operator in javascript

Example

Try Yourself

Unary negation in javascript

Example

Try Yourself

Unary plus in javascript

Example

Try Yourself