Question
Are there other mathematical operators of the form (operator)=
, like +=
, other than the ones listed in this lesson?
Answer
Yes, there’s pretty much one for every simple mathematical operator. There’s one for /=
and %=
which logically work the same their +=, -=, and *= counterparts. Example:
javascript let x = 10; x /= 2; console.log(x) // Returns 5