Thursday, July 30, 2026
HomeLanguagesJavascriptExponentiation Assignment(**=) Operator in JavaScript

Exponentiation Assignment(**=) Operator in JavaScript

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');


 

Output

36
1
NaN

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

Javascript




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


Output

NaN

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

Supported Browser:

  • Chrome 52
  • Edge 14
  • Firefox 52
  • Opera 39
  • Safari 10.1
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

4 COMMENTS

Most Popular

Dominic
32520 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6903 POSTS0 COMMENTS
Nicole Veronica
12017 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12115 POSTS0 COMMENTS
Shaida Kate Naidoo
7023 POSTS0 COMMENTS
Ted Musemwa
7265 POSTS0 COMMENTS
Thapelo Manthata
6981 POSTS0 COMMENTS
Umr Jansen
6973 POSTS0 COMMENTS