None. As you can read in the ES7 spec, both Math.pow and the ** exponentation operator cast their arguments/operands to numbers and use the very same algorithm to determine the result.

Addendum: this changed with the introduction of the BigInt type in ES2020, whose values are only supported by operators (including **) but not the Math object.

Answer from Bergi on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math › pow
Math.pow() - JavaScript | MDN
A number representing base taken to the power of exponent. Returns NaN in one of the following cases: ... Math.pow() is equivalent to the ** operator, except Math.pow() only accepts numbers.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › difference-between-math-pow-and-in-javascript
Difference Between Math.pow() and ** in JavaScript - GeeksforGeeks
July 23, 2025 - The ** operator is the exponentiation operator introduced in the ECMAScript 2016 (ES7). The exponentiation operator ** returns the result of the raising the base to the power of the exponent similar to the Math.pow().
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Operators › Exponentiation
Exponentiation (**) - JavaScript | MDN
The exponentiation (**) operator returns the result of raising the first operand to the power of the second operand. It is equivalent to Math.pow(), except it also accepts BigInts as operands.
🌐
MeasureThat
measurethat.net › Benchmarks › Show › 5905 › 0 › mathpow-vs-vs
Benchmark: Math.pow vs ** vs * - MeasureThat.net
pow vs exponentiation · Math.pow() vs exponentiation operator · Math.pow vs Exponentiation vs Multiplication · Math.pow vs Exponentiation vs Multiplication pow 4 · math.pow vs multiply vs exponentiation · Comments · Do you really want to delete benchmark?
🌐
W3Schools
w3schools.com › jsref › jsref_pow.asp
JavaScript Math pow() Method
Math.pow() is an ECMAScript1 (JavaScript 1997) feature.
🌐
ESLint
eslint.org › docs › latest › rules › prefer-exponentiation-operator
prefer-exponentiation-operator - ESLint - Pluggable JavaScript Linter
Introduced in ES2016, the infix exponentiation operator ** is an alternative for the standard Math.pow function.
Find elsewhere
🌐
MeasureThat
measurethat.net › Benchmarks › Show › 1651 › 0 › math-pow-vs-multiply
Benchmark: math pow vs multiply - MeasureThat.net
JavaScript benchmarks, JavaScript performance playground. Measure performance accross different browsers. javascript benchmarks online.
🌐
Biome
biomejs.dev › linter › rules › use-exponentiation-operator
useExponentiationOperator | Biome
Introduced in ES2016, the infix exponentiation operator ** is an alternative for the standard Math.pow function. Infix notation is considered to be more readable and thus more preferable than the function notation. ... code-block.js:1:13 lint/style/useExponentiationOperator FIXABLE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ℹ Use the ’**’ operator instead of ‘Math.pow’. > 1 │ const foo = Math.pow(2, 8); │ ^^^^^^^^^^^^^^ 2 │ ℹ Safe fix: Use the ’**’ operator instead of ‘Math.pow’. 1 │ - const·foo·=·Math.pow(2,·8); 1 │ + const·foo·=·2·**·8; 2 2 │
🌐
Edgecompute
js-compute-reference-docs.edgecompute.app › math.pow()
Math.pow() | @fastly/js-compute
A number representing base taken to the power of exponent. Returns NaN in one of the following cases: ... Math.pow() is equivalent to the ** operator, except Math.pow() only accepts numbers.
🌐
Jsremote
jsremote.jobs › tutorials › math-pow
The Math.pow() method in JavaScript? | Web developer jobs
Even though Mathematics allows calculating odd roots of negative numbers, the Math.pow() function is not capable of that. For example, the result of execution Math.pow (-27, 1/3) will be NaN, although after manual calculation you will get -3. There are two ways to resolve this issue. First of all, you can use a built-in function Math.cbrt() for fast calculation of a cube root.
🌐
DEV Community
dev.to › mayallo › exponentiation-in-javascript-a-beginners-guide-5gdj
Exponentiation in JavaScript: A Beginner’s Guide - DEV Community
July 8, 2023 - In this example, regarding result1, 3 is raised to the power of 2 first, resulting in 9. Then, the multiplication is performed, resulting in a final value of 18. But if you want to precede the multiplication operator in the case of result2, you have to enclose the multiplication operation between (). Another example, if you want to find the nth roots: let result1 = 8 ** 1 / 3, // 2.6666666666666665 result2 = 8 ** (1 / 3); // 2 · In addition to the ** operator, JavaScript also provides the Math.pow() method for performing exponentiation.
🌐
LaunchCode
education.launchcode.org › intro-to-professional-web-dev › appendices › math-method-examples › pow-examples.html
Math.pow and Math.sqrt Examples — Introduction to Professional Web Development in JavaScript documentation
This method calculates and returns the square root of number, and it is a shortcut for using the fraction 1/2 in the pow method. Numerical strings can also be evaluated, but should be avoided as a best practice. ... Math.sqrt also works on arrays, but must be combined with the map array method.
🌐
TutorialsPoint
tutorialspoint.com › home › javascript › javascript math.pow() function
JavaScript Math.pow() Function
September 1, 2008 - This method takes two arguments: the base (the number we want to raise) and the exponent (the power to which we want to raise the base). Following are the cases, where this method returns "NaN" as result − · If the exponent is NaN.
🌐
Math.js
mathjs.org › docs › reference › functions › pow.html
math.js
Calculates the power of x to y, x ^ y. Matrix exponentiation is supported for square matrices x and integers y: when y is nonnegative, x may be any square matrix; and when y is negative, x must be invertible, and then this function returns inv(x)^(-y). For cubic roots of negative numbers, the ...
🌐
GitHub
github.com › liquidcarrot › carrot › issues › 188
Exponentiation (**) operator ~x2 faster than Math.pow() · Issue #188 · liquidcarrot/carrot
May 24, 2019 - Exponentiation (**) operator ~x2 faster than Math.pow()#188 · Copy link · GavinRay97 · opened · on Nov 13, 2019 · Issue body actions · https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Ex...
Published   Nov 13, 2019
🌐
Programiz
programiz.com › javascript › library › math › pow
JavaScript Math.pow() (with Examples)
The pow() method computes the power of a number by raising the second argument to the power of the first argument.
Top answer
1 of 4
7

Brief :

use parseInt or Math.floor to have y/2 as integer, unleness you will not reach 0 which is the stopper of recursion .


Details

if you want to transalte [C Algo]:

int power(int x, unsigned int y)
{
    if( y == 0)
        return 1;
    else if (y%2 == 0)
        return power(x, y/2)*power(x, y/2);
    else
        return x*power(x, y/2)*power(x, y/2);
 
}

To [JS Algo] , you will have :

function power(x,y){
     if(y===0){return 1}
     else if (y%2 ===0){
         return power(x,parseInt(y/2))*power(x,parseInt(y/2))
     }else{
          return x*power(x,parseInt(y/2))*power(x,parseInt(y/2))
     }

}

DEMO :

    function power(x,y){
         if(y===0){return 1}
         else if (y%2 ===0){
             return power(x,parseInt(y/2))*power(x,parseInt(y/2))
         }else{
              return x*power(x,parseInt(y/2))*power(x,parseInt(y/2))
         }
    
    }


console.log(power(3,2))

2 of 4
2

Try this out

It will give you the same result of JavaScript build in method ( Math.pi(x, y)) but the only problem is you can't use Power as decimal number.

Math.my_pow = (x, y) => {
  if (typeof x != "number" || typeof y != "number")
    throw "(x) and (y) should only be number";

  if (y == 0) return 1;
  if (x == 0 && y > 0 ) return 0;

  const base = x;
  var value = base;
  var pow = y;
  if (y < 0) pow = y * -1;

  for (var i = 1; i < pow; i++) {
    value *= base;
  }

  if (y < 0) return 1 / value;
  return value;
};

try {
  console.log( Math.my_pow(0, -3) );
  console.log( Math.pow(0, -2) );

  console.log( Math.my_pow(-5, -3) );
  console.log( Math.pow(-5, -3) );

  console.log( Math.my_pow(8, -7) );
  console.log( Math.pow(8, -7)) ;
} catch (err) {
  console.log(err);
}