Assignment Operators List
There are so many assignment operators as shown in the table with the description.
OPERATOR NAME | SHORTHAND OPERATOR | MEANING |
---|---|---|
Addition Assignment | a+=b | a=a+b |
Subtraction Assignment | a-=b | a=a-b |
Multiplication Assignment | a*=b | a=a*b |
Division Assignment | a/=b | a=a/b |
Remainder Assignment | a%=b | a=a%b |
Exponentiation Assignment | a**=b | a=a**b |
Left Shift Assignment | a<<=b | a=a<<b |
Right Shift Assignment | a>>=b | a=a>>b |
Bitwise AND Assignment | a&=b | a=a&b |
Bitwise OR Assignment | a|=b | a=a | b |
Bitwise XOR Assignment | a^=b | a=a^b |
a&&=b | x && (x = y) | |
||= | x || (x = y) | |
??= | x ?? (x = y) |