Arithmetic Operators in JavaScript

 JavaScript Arithmetic Operators

There are many arithmetic operators in JavaScript.

1) Addition                     +
2) Subtraction                 -
3) Multiplication            *
4) Division                      /
5) Modulus                     %
6) Power                          **
7) Increment                   ++
8) Decrement                   --

Arithmetic Operators With Code Examples

let a = 4;
let b = 2;
document.write(a+b);
document.write(a-b);
document.write(a*b);
document.write(a/b);
document.write(a%b);
document.write(a**b);
// ++ operator use for adding 1
++a;        
a++;
// -- operator use for subtract 1        
--a;          
a--;
document.write(a);


See more details please watch my video Click Here

Post a Comment

Previous Post Next Post