Assignment Operators in javascript
In javascript assignment operator are used to assign a value to a variable.
S.No | Symbol | Name | Description | Example |
---|---|---|---|---|
=
|
Assignment | It is used to assign values to the given variable. | Try | |
+=
|
Addition assignment | It is used to add the right side value with the value of left side variable and store the result in the same variable. | Try | |
-=
|
Subtraction assignment | It is used to subtract the right side value with the value of left side variable and store the result in the same variable. | Try | |
*=
|
Multiplication assignment | It is used to multiply the right side value with the value of left side variable and store the result in the same variable. | Try | |
/=
|
Division assignment | It is used to divide the right side value with the value of left side variable and store the quotient in the same variable. | Try | |
%/
|
Remainder assignment | It is used to divide the right side value with the value of left side variable and store the remainder in the same variable. | Try | |
<<=
|
Left shift assignment |
|
Try | |
>=
|
Right shift assignment |
|
Try | |
>>>=
|
Unsigned right shift assignment |
|
Try | |
&=
|
Bitwise AND assignment | It converts the given numerical values into binary value, and does binary AND opertaion, and the result will be stored in the left side variable. | Try | |
^=
|
Bitwise XOR assignment | It converts the given numerical values into binary value, and does binary XOR opertaion, and the result will be stored in the left side variable. | Try | |
|=
|
Bitwise OR assignment | It converts the given numerical values into binary value, and does binary OR opertaion, and the result will be stored in the left side variable. | Try |