๋นผ๊ธฐ (-)
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itโs been available across browsers since โจ2015๋ 7์โฉ.
๋นผ๊ธฐ ์ฐ์ฐ์(-
)๋ ๋ ์ฐ์ฐ์์ ์ฐจ์ด๋ฅผ ๊ตฌํฉ๋๋ค.
์๋ํด ๋ณด๊ธฐ
console.log(5 - 3);
// Expected output: 2
console.log(3.5 - 5);
// Expected output: -1.5
console.log(5 - "hello");
// Expected output: NaN
console.log(5 - true);
// Expected output: 4
๊ตฌ๋ฌธ
js
x - y;
์์
๋บ์
js
5 - 3; // 2
3 - 5; // -2
์ซ์๊ฐ ์๋ ๊ฒฝ์ฐ
js
"foo" - 3; // NaN
๋ช ์ธ
Specification |
---|
ECMAScriptยฎ 2026 Language Specification # sec-subtraction-operator-minus |
๋ธ๋ผ์ฐ์ ํธํ์ฑ
Loadingโฆ