ëë기 (/)
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(12 / 2);
// Expected output: 6
console.log(3 / 2);
// Expected output: 1.5
console.log(6 / "3");
// Expected output: 2
console.log(2 / 0);
// Expected output: Infinity
구문
js
x / y;
ìì
>기본 ëëì
js
1 / 2; // 0.5
Math.floor(3 / 2); // 1
1.0 / 2.0; // 0.5
0ì¼ë¡ ëë기
js
2.0 / 0; // Infinity
2.0 / 0.0; // Infinity, 0.0 === 0ì´ê¸° ë문
2.0 / -0.0; // -Infinity
ëª ì¸
| Specification |
|---|
| ECMAScript® 2027 Language Specification > # sec-multiplicative-operators > |