A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.geeksforgeeks.org/javascript/exponentiation-assignment-operator-in-javascript/ below:

Exponentiation Assignment(**=) Operator in JavaScript

Exponentiation Assignment(**=) Operator in JavaScript

Last Updated : 23 Jul, 2025

JavaScript Exponentiation Assignment Operator in JavaScript is represented by "**=". This operator is used to raise the value of the variable to the power of the operand which is right. This can also be explained as the first variable is the power of the second operand. The exponentiation operator is equal to Math.pow().

Syntax:

a **= b
or
a = a ** b

Example 1: In this example, we will use the exponentiation assignment operator.

JavaScript
let x = 6;
console.log(x **= 2);
console.log(x **= 0);
console.log(x **= 'bar');
 

Example 2: In this example, we will use the exponentiation operator to the NaN.

JavaScript
let x = NaN;
console.log(x **= 2);

We have a complete list of Javascript Assignment Operators, Please check this article Javascript Assignment Operator.

Supported Browser:



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4