This page was translated from English by the community.Learn more and join the MDN Web Docs community.
할당 연산자 (=)
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월.
할당(=) 연산자는 변수에 값을 대입하는 데 사용됩니다. 할당 연산은 할당된 값으로 평가됩니다. 할당 연산자를연결하여 사용하면 단일 값을 여러 변수에 할당할 수 있습니다.
In this article
시도해 보기
let x = 2;const y = 3;console.log(x);// Expected output: 2console.log((x = y + 1)); // 3 + 1// Expected output: 4console.log((x = x * y)); // 4 * 3// Expected output: 12구문
js
x = y예제
>간단한 대입과 연결하여 사용
js
let x = 5;let y = 10;let z = 25;x = y; // x 는 10입니다.x = y = z; // x, y, z 는 모두 25입니다.명세
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-assignment-operators> |