Black lives matter
Portrait Dr. Axel Rauschmayer
Dr. Axel Rauschmayer
Homepage | Twitter
Cover of book “JavaScript for impatient programmers”
Book, exercises, quizzes
(free to read online)
Cover of book “Deep JavaScript”
Book (50% free online)
Cover of book “Tackling TypeScript”
Book (first part free online)
Logo of newsletter “ news”
Newsletter (free)

ES2016 feature: exponentiation operator (**)

[2016-02-01] dev, javascript, esnext, es2016
(Ad, please don’t block)

The exponentiation operator (**) is an ECMAScript proposal by Rick Waldron. It is at stage 4 (finished) and part of ECMAScript 2016.

An infix operator for exponentiation  

** is an infix operator for exponentiation:

x ** y

produces the same result as

Math.pow(x, y)


let squared = 3 ** 2; // 9

let num = 3;
num **= 2;
console.log(num); // 9

Further reading: