diff options
Diffstat (limited to 'files/zh-cn/web/javascript/reference/operators/exponentiation_assignment/index.html')
-rw-r--r-- | files/zh-cn/web/javascript/reference/operators/exponentiation_assignment/index.html | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/files/zh-cn/web/javascript/reference/operators/exponentiation_assignment/index.html b/files/zh-cn/web/javascript/reference/operators/exponentiation_assignment/index.html new file mode 100644 index 0000000000..12f77694c7 --- /dev/null +++ b/files/zh-cn/web/javascript/reference/operators/exponentiation_assignment/index.html @@ -0,0 +1,59 @@ +--- +title: Exponentiation assignment (**=) +slug: Web/JavaScript/Reference/Operators/Exponentiation_assignment +translation_of: Web/JavaScript/Reference/Operators/Exponentiation_assignment +--- +<div>{{jsSidebar("Operators")}}</div> + +<p>The exponentiation assignment operator (<code>**=</code>) raises the value of a variable to the power of the right operand.</p> + +<div>{{EmbedInteractiveExample("pages/js/expressions-exponentiation-assignment.html")}}</div> + +<div></div> + + + +<h2 id="语法">语法</h2> + +<pre class="syntaxbox notranslate"><strong>Operator:</strong> x **= y +<strong>Meaning:</strong> x = x ** y</pre> + +<h2 id="Examples">Examples</h2> + +<h3 id="Using_exponentiation_assignment">Using exponentiation assignment</h3> + +<pre class="brush: js notranslate">// Assuming the following variable +// bar = 5 + +bar **= 2 // 25 +bar **= 'foo' // NaN</pre> + +<h2 id="Specifications">Specifications</h2> + +<table class="standard-table"> + <tbody> + <tr> + <th scope="col">Specification</th> + </tr> + <tr> + <td>{{SpecName('ESDraft', '#sec-assignment-operators', 'Assignment operators')}}</td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility">Browser compatibility</h2> + + + +<p>{{Compat("javascript.operators.exponentiation_assignment")}}</p> + +<h2 id="See_also">See also</h2> + +<ul> + <li><a href="/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators#Assignment">Assignment operators in the JS guide</a></li> + <li><a href="/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation">Exponentiation operator</a></li> +</ul> + +<p> + <audio style="display: none;"></audio> +</p> |