[ Web Proxy ]
URL:
Viewing: https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Operators/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 ..

(=) . . (chaining) .

In this article

let x = 2;
const y = 3;

console.log(x);
// Expected output: 2

console.log((x = y + 1)); // 3 + 1
// Expected output: 4

console.log((x = x * y)); // 4 * 3
// Expected output: 12

: x = y

js
//      
//  x = 5
//  y = 10
//  z = 25

x = y; // x    10
x = y = z; // x, y  z   25

Specification
ECMAScript 2027 LanguageSpecification
# sec-assignment-operators


Web Proxy Viewer  |  New URL  |  Original Page