[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Operators/Exponentiation_assignment [Back]  [Original]

(**=) - JavaScript | MDN

MDN Web Docs

View in English Always switch to English

(**=)

Baseline

20173

(**=) 2

let a = 3;

console.log((a **= 2));
// : 9

console.log((a **= 0));
// : 1

console.log((a **= "hello"));
// : NaN

js
x **= y

x **= y x = x ** y x

js
let bar = 5;
bar **= 2; // 25

js
let baz = 5;
baz **= "foo"; // NaN

js
let foo = 3n;
foo **= 2n; // 9n
foo **= 1; // TypeError: Cannot mix BigInt and other types, use explicit conversions

ECMAScript 2027 LanguageSpecification
# sec-assignment-operators


Web Proxy Viewer  |  New URL  |  Original Page