Arithmetic Operators in Javascript

Arithmetic Operators in Javascript

These are the operators which perform arithmetic operations in Javascript on the numbers.

Here is a list of some arithmetic operators in Javascript, with their descriptions in brief —

OperatorDescription
+This operator is used for the addition operation
This operator is used for the subtraction operation
*This operator is used for a multiplication operation
/This operator is used for division operation
%This operator is used to get the remainder when we divide two numbers.
**This operator is used to calculate the power of some number. For example, 2**4 can compute the 4thpower of 2.
++This operator is used for incrementation operation, i.e adding 1 to some number.
This operator is used for decrementation operation, i.e subtracting 1 from some number.

Now, let’s have a look at a program, with which, we can better understand the use of arithmetic operators –

As you can see in the above program, we have tried using some arithmetic operations, which help us in arithmetic operations, like addition, subtraction, multiplication, division, etc. So, now let’s have a look at the output –

So, you can use the arithmetic operators, as we have used them in the above program for demonstration purposes. We are going to make use of the arithmetic operators, as and when required. You would get familiar with the concept, as we keep on using it. You can try observing the outputs, and also try using some symbols by yourself.