Skip to content

Instantly share code, notes, and snippets.

@QuatoHub
Last active September 11, 2021 09:06
Show Gist options
  • Save QuatoHub/4318395b6053b8752e267199319a03a9 to your computer and use it in GitHub Desktop.
Save QuatoHub/4318395b6053b8752e267199319a03a9 to your computer and use it in GitHub Desktop.
let x = 5,
result;
// 선할당 후증가(postfix increment operatior)
result = x++;
console.log(result, x); // 5 6
// 선증가 후할당(prefix increment operatior)
result = ++x;
console.log(result, x); // 7 7
// 선할당 후감소(postfix decrement operatior)
result = x--;
console.log(result, x); // 7 6
// 선감소 후할당(prefix decrement operatior)
result = --x;
console.log(result, x); // 5 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment