In JavaScript, “Arithmetic Operators” are the basic operators that perform arithmetic operations on attributes.

Addition operator ( + )

→ It adds numbers

var x = 10;
var y = 9;
var z = x + y;
console.log(z);

// Result → 19

Subtraction operator ( – )

→ It subtracts numbers.

var x = 10;
var y = 9;
var z = x - y;
console.log(z);

// Result → 1

Multiplication operator ( * )

→ It multiplies numbers.

var x = 10;
var y = 9;
var z = x * y;
console.log(z);

// Result → 90

Division operator ( / )

→ It divides numbers.

var x = 90;
var y = 9;
var z = x / y;
console.log(z);

// Result → 10

Modulus operator ( % )

→ It returns the division remainder.

var x = 90;
var y = 9;
var z = x % y;
console.log(z);

// Result → 0

Increment operator ( ++ )

→ It increments numbers.

var x = 10;
x++;
console.log(x);

// Result → 11

Decrement operator ( — )

→ It decrements numbers.

var x = 10;
x--;
console.log(x);

// Result → 9

Exponentiation operator ( ** )

→ It is used to add an exponent to another number.

var x = 10 ** 2;
console.log(x);

// Result → 100

Fabio

Full Stack Developer

About the Author

I’m passionate about web development and design in all its forms, helping small businesses build and improve their online presence. I spend a lot of time learning new techniques and actively helping other people learn web development through a variety of help groups and writing tutorials for my blog about advancements in web design and development.

View Articles