Combined assignment operations
It is possible to make a shortcut by combining both assignment operator with mathematics operation such as addition or subtraction.
Adding a number and assigning the result will be represented by += operation. Similar to above it is possible to perform subtraction. Such operation will be represented by -= signs.
It is also possible to perform multiplication or division operations in a similar manner.
One more operation that is done this way is modulus or remainder operation. It is represented by percentage sign.
Comments
Post a Comment