HOME C C++ PYTHON JAVA HTML CSS JAVASCRIPT BOOTSTRAP JQUERY REACT PHP SQL AJAX JSON DATA SCIENCE AI

JavaScript Arithmetic

JavaScript Arithmetic Operators

Operator Description Example
+ The addition operator (+) adds numbers: z = x + y;
- The subtraction operator (-) subtracts numbers. z = x - y;
* The multiplication operator (*) multiplies numbers. z = x * y;
/ The division operator (/) divides numbers. z = x / y;
% The modulus operator (%) returns the division remainder. z = x % y;
++ The increment operator (++) increments numbers. z = x;
-- The decrement operator (--) decrements numbers. z = x;
** The exponentiation operator (**) raises the first operand to the power of the second operand. z = x ** 2;