📜  ++i 与 i++ - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:14.134000             🧑  作者: Mango

代码示例1
// ++i will increment the value of i, and then return the incremented value.

 i = 1;
 j = ++i;
 (i is 2, j is 2)

// i++ will increment the value of i, but return the original value that i held before being incremented.

 i = 1;
 j = i++;
 (i is 2, j is 1)