# What are the 5 JavaScript Mathematical Operators?

What are the 5 JavaScript Mathematical Operators?

Arithmetic Operators

Arithmetic operators perform arithmetic functions on numbers (literals or variables) and return a value.

JavaScript includes many operators from basic math as well as a few programming-specific operators.

There are five fundamental operations in mathematics: addition, subtraction, multiplication, division, and modulas.

Here is a reference table of JavaScript arithmetic operators.

## Basic Syntax

A typical arithmetic operation operates on two numbers.
The two numbers can be literals:

``````let sum = 100 + 80;
//Output 180``````

or variables:

``````let a = 100;
let b = 60;
let sum = a + b;
//Output 160``````

## Operators and Operands

The numbers (in an arithmetic operation) are called operands.
The operation (to be performed between the two operands) is defined by an operator.

Example

The addition operator (`+`) adds numbers:

``````let x = 6;
let y = 2;
let z = x + y;
// Output 8``````

## Subtracting

The subtraction operator (`-`) subtracts numbers.

``````let x = 8;
let y = 2;
let z = x - y;
// Output 6``````

## Multiplying

The multiplication operator (`*`) multiplies numbers.

``````let x = 6;
let y = 2;
let z = x * y;
// Output 12``````

## Remainder

The modulus (also known as remainder) operator (`%`). The remainder operator returns the remainder left over when one operand is divided by a second operand.

``````let x = 9;
let y = 0;
let z = x % y;
// Output 0``````

As an example, we know that 3 goes into 9 exactly three times, and there is no remainder.

## Incrementing

The increment operator (`++`) increments numbers. Increment operators increase the numerical value by one.

``````let x = 5;
x++;
let z = x;
// Output 6``````

## Decrementing

The decrement operator (`—`) decrements numbers. Decrement operators reduce the numerical value by one.

``````let x = 9;
x--;
let z = x;
// Output 8``````

## Conclusion

We covered arithmetic operators and syntax in this article, including many common mathematical operators as well as a few that are unique to programming.