# JavaScript Arithmetic Operators

Arithmetic operations in JavaScript; Through this tutorial, i am going to show you in detail about arithmetic operators in javascript. And as well as how to use javascript arithmetic operators.

## Arithmetic operators in javaScript

See the following types of JavaScript arithmetic operators; as shown below in list:

If the operands are numbers, JavaScript `+` operator performs addition between two or more operands.

See the following example:

```var a = 10;
var b = 20;
console.log(a + b); // 30```

The `+` operator performs concatenation operation when one of the operands is contained a string value.

See the following example:

```var a = 50, b = "Hello ", c = 15;
a + b; // "5Hello "
a + c; // 65```

### Subtraction between operands

JavaScript `-` operator performs a subtraction between operands.

See the following example:

```var a = 10;
var b = 20;
console.log(b - a); // 10```

### Division between operands

JavaScript `/` operator performs a division between operands.

See the following example:

```var a = 10;
var b = 20;
console.log(b / a); // 2```

If you divide by zero, JavaScript does not raise any error but returns the `Infinity` value.

See the following example:

```var a = 0;
var b = 20;
console.log(b / a); // Infinity```

### Remainder between operands

How to perform javascript`%` operator between operands.

See the following example:

```var a = 5;
var b = 20;
console.log(b % a); //zero```

A reminder by zero is always `NaN`, a special value that means “Not a Number”.

See the following example:

```var a = 0;
var b = 20;
console.log(b % a); //NaN```

### Multiplication between operands

Javascript `*` operator performs multiplication between operands.

See the following example:

```var a = 5;
var b = 20;
console.log(b * a); //100```

If you multiply by zero is always `0`.

Consider the following example:

```var a = 0;
var b = 20;
console.log(b * a); //0```

### Increment with operand

This is a unary operator, and if put before the number, it returns the value incremented.

See the following example:

```var a = 0;
var b = 0;
console.log(a++); //0
console.log(++b); //1```

### Decrement with operand

This is a unary operator, and if put before the number, it returns the value decremented.

See the following example:

```var a = 2;
var b = 2;
console.log(a--); //2
console.log(--b); //1```

## Conclusion

In this tutorial, you have learned what is javascript arithmetic operators and how to use JavaScript arithmetic operators.