This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

๋‚˜๋ˆ„๊ธฐ ํ• ๋‹น (/=)

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

๋ธŒ๋ผ์šฐ์ € ํ˜ธํ™˜์„ฑ

๊ฐ™์ด ๋ณด๊ธฐ