--- title: Multiplication assignment (*=) slug: Web/JavaScript/Reference/Operators/Multiplication_assignment translation_of: Web/JavaScript/Reference/Operators/Multiplication_assignment --- <div>{{jsSidebar("Operators")}}</div> <p>The multiplication assignment operator (<code>*=</code>) multiplies a variable by the value of the right operand and assigns the result to the variable.</p> <div>{{EmbedInteractiveExample("pages/js/expressions-multiplication-assignment.html")}}</div> <h2 id="语法">语法</h2> <pre class="syntaxbox"><strong>Operator:</strong> x *= y <strong>Meaning:</strong> x = x * y</pre> <h2 id="Examples">Examples</h2> <h3 id="Using_multiplication_assignment">Using multiplication assignment</h3> <pre class="brush: js">// Assuming the following variable // bar = 5 bar *= 2 // 10 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.multiplication_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/Multiplication">Multiplication operator</a></li> </ul>