![]() |
VOOZH | about |
In JavaScript, the Exponentiation Assignment Operator (**=) is used to raise a variable to the power of the right-hand operand and assign the result back to the variable. It provides a shorter and more readable way to perform exponentiation. This operator works the same way as the Math.pow() method.
Syntax:
a **= b
or
a = a ** b
[Example 1]: We will use the exponentiation assignment operator.
[Example 2]: We will use the exponentiation operator to the NaN.