Top Categories
JavaScript Tutorial For Beginners #9 - Math Operator Short-hand
- Category:
- Sub Category:
Hey guys. In this JavaScript tutorial I want to build on what we've already learnt about mathematical operators, and show you a few cool short-hand notation versions that will save you time. += is the short-hand for adding to the current variable -= is the short-hand for subtracting from the
Hey guys. In this JavaScript tutorial I want to build on what we've already learnt about mathematical operators, and show you a few cool short-hand notation versions that will save you time. += is the short-hand for adding to the current variable -= is the short-hand for subtracting from the current variable *= is the short-hand for multiplying by the current variable /= is the short-hand for dividing the current variable ++var or var++ are the incremental operators (increase the value of the variable by 1). --var or var-- are the decremental operators (decrease the value of the variable by 1). As usual, comment down below with any questions :).