--- title: Exponentiation assignment (**=) slug: Web/JavaScript/Reference/Operators/Exponentiation_assignment translation_of: Web/JavaScript/Reference/Operators/Exponentiation_assignment ---
The exponentiation assignment operator (**=
) raises the value of a variable to the power of the right operand.
Operator: x **= y Meaning: x = x ** y
// Assuming the following variable // bar = 5 bar **= 2 // 25 bar **= 'foo' // NaN
Specification |
---|
{{SpecName('ESDraft', '#sec-assignment-operators', 'Assignment operators')}} |
{{Compat("javascript.operators.exponentiation_assignment")}}