減算演算子 (-
) は2つのオペランドを減算し、それらの差を生成します。
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.
構文
Operator: x - y
例
数値による減算
5 - 3 // 2
3 - 5 // -2
非数による減算
'foo' - 3 // NaN
仕様
ブラウザーの互換性
BCD tables only load in the browser
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.