DEV Community

ViGnEsH
ViGnEsH

Posted on

“JavaScript Arithmetic Operators Tutorial with Examples”

_Today, March 19 2026 _

Let’s go operator by operator in JavaScript with small, runnable code examples. I’ll show one operator at a time so it’s easy to understand.

Used for mathematical operations.

operations

Addition +
Subtraction -
Multiplication *
Division /
Remaninder %
Exponent **

Math.floor(a/b) Floor Division alternative

1️⃣ Addition (+)

Adds two numbers.

Output:


2️⃣ Subtraction (-)

Subtracts one number from another.

Output:


3️⃣ Multiplication (*)

Multiplies two numbers.

Output:


4️⃣ Division (/)

Divides one number by another.

Output:


5️⃣ Modulus (%)

Gives the remainder after division.

Output:


_6️⃣ Exponent ()_**

Raises a number to the power of another.

Output:


7️⃣ Floor Division Alternative (Math.floor)

JavaScript doesn’t have //, but you can use Math.floor:

Output:


💡 Tip: You can combine operators like:

Output:

TIP: Practice one operator per day with small code snippets

Top comments (0)