ëë기 í ë¹ (/=)
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ìâ©.
ëë기 í ë¹ ì°ì°ì(/=)ë ì¤ë¥¸ìª½ í¼ì°ì°ìì ê°ì¼ë¡ ë³ì를 ëë 결과를 ë¤ì ë³ìì í ë¹í©ëë¤.
ìëí´ ë³´ê¸°
let a = 3;
a /= 2;
console.log(a);
// Expected output: 1.5
a /= 0;
console.log(a);
// Expected output: Infinity
a /= "hello";
console.log(a);
// Expected output: NaN
구문
js
x /= y; // x = x / y
ìì
>ëë기 í ë¹ ì¬ì©í기
js
// bar = 5
// ìì ê°ì ë³ì를 ê°ì íê³ , ìëì 모ë ì°ì°ì ììëë¡ ì¤íí ë
bar /= 2; // 2.5
bar /= 2; // 1.25
bar /= 0; // Infinity
bar /= "foo"; // NaN
ëª ì¸
| Specification |
|---|
| ECMAScript® 2026 Language Specification > # sec-assignment-operators > |