幂赋值(**=)
幂赋值(**=
)运算符将左侧变量的值设置为右操作数的幂次方。
尝试一下
语法
x **= y // x = x ** y
示例
使用幂赋值
let bar = 5;
bar **= 2; // 25
bar **= "foo"; // NaN
规范
Specification |
---|
ECMAScript Language Specification # sec-assignment-operators |
浏览器兼容性
BCD tables only load in the browser