Skip to content

Instantly share code, notes, and snippets.

@showlovezz
Last active March 12, 2020 00:54
Show Gist options
  • Save showlovezz/2584da066460bbe87803afdba7f3de08 to your computer and use it in GitHub Desktop.
Save showlovezz/2584da066460bbe87803afdba7f3de08 to your computer and use it in GitHub Desktop.
鼠年全馬鐵人挑戰 - 6-2
// 以下左右兩邊的意思是相同的
x++ <==> x = x + 1;
x-- <==> x = x - 1;
// Example 1
var x = 10;
var y = x++;
console.log(x) // 會得到 11
console.log(y) // 會得到 10
// Example 2
var x = 10;
var y = ++x;
console.log(x) // 會得到 11
console.log(y) // 會得到 11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment