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

(++) (1 ) .

In this article

let x = 3;
const y = x++;

console.log(`x:${x}, y:${y}`);
// Expected output: "x:4, y:3"

let a = 3;
const b = ++a;

console.log(`a:${a}, b:${b}`);
// Expected output: "a:4, b:4"

js
x++
++x

( x++) .

( ++x) .

, . ++x .

js
++(++x); // SyntaxError: Invalid left-hand side expression in prefix operation

js
let x = 3;
const y = x++;

// x = 4
// y = 3

js
let x = 3;
const y = ++x;

// x = 4
// y = 4

Specification
ECMAScript 2027 LanguageSpecification
# sec-postfix-increment-operator


Web Proxy Viewer  |  New URL  |  Original Page