Exponentiation Operator

An operator has been proposed for JavaScript to perform exponentiation in the same way that Math.pow(..) does. Consider:

  1. var a = 2;
  2. a ** 4; // Math.pow( a, 4 ) == 16
  3. a **= 3; // a = Math.pow( a, 3 )
  4. a; // 8

Note: ** is essentially the same as it appears in Python, Ruby, Perl, and others.