Loading, please wait...

Assignment Operators

Assignment Operators

In JavaScript, the assignment operator has used in a way that it assigns a value to the left operand based on the right operand.

Assignment (=) Operator is mainly used to assign values.

 

The table shows the following assignment operators are as follows:

 

      Operator

          Example

      Equivalent

            =

            x = y

           x = y

           +=

           x += y

         x = x + y

            -=

           x -= y

         x = x – y

           *=

           x *= y

         x = x * y

           /=

           x /= y

         x = x / y

          %=

           x %= y

         x = x % y