除算代入 (/=)
除算代入演算子 (/=
) は変数を右オペランドの値で除算し、結果をその変数に代入するものです。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
構文
演算子: x /= y 意味: x = x / y
例
除算代入の使用
// 以下の変数があると想定する
// bar = 5
bar /= 2 // 2.5
bar /= 'foo' // NaN
bar /= 0 // Infinity
仕様書
ブラウザーの互換性
BCD tables only load in the browser