[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Division_assignment [Back]  [Original]

(/=) - JavaScript | MDN

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. Its been available across browsers since 2015 7.

(/=) .

In this article

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 2027 LanguageSpecification
# sec-assignment-operators


Web Proxy Viewer  |  New URL  |  Original Page