The increment operator increments, and the decrement operator decrements, the value of a variable by one.
Syntaxresult = ++ variable
result = -- variable
result = variable ++
result = variable --
See Remarks.
var k = 5;
var j;
j = ++k;
j = k++;
Remarks
If the operator appears before the variable, the value is modified before the expression is evaluated. If the operator appears after the variable, the value is modified after the expression is evaluated. In other words, given j = ++k;
, the value of j
is the original value of k
plus one; given j = k++;
, the value of j
is the original value of k
, which is incremented after its value is assigned to j
.
Microsoft Developer Network: Article
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4