乗算代入 (*=)

乗算代入演算子 (*=) は、変数に右のオペランドの値を乗算し、結果を変数に代入します。

試してみましょう

構文

js
x *= y; // x = x * y

乗算代入の使用

js
// 次の変数を想定
//  bar = 5

bar *= 2; // 10
bar *= "foo"; // NaN

仕様書

Specification
ECMAScript Language Specification
# sec-assignment-operators

ブラウザーの互換性

BCD tables only load in the browser

関連情報