Skip to content

Commit 980fd39

Browse files
committed
Postfix ++
1 parent 9910568 commit 980fd39

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

docs/New Operators.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,17 @@ Compound operators are syntactic sugar. They'll call the same metamethods as the
3636
:::
3737

3838
## Increment Operator
39-
In addition to the compound operator `+=`, there is an even faster way to increment a value by 1 using the prefixed ++ operator:
39+
In addition to the compound operator `+=`, there is an even faster way to increment a value by 1 using the ++ operator:
4040
```pluto
4141
local a = 1
42+
-- Prefix
4243
print(++a) --> 2
4344
++a
4445
print(a) --> 3
46+
-- Postfix
47+
print(a++) --> 3
48+
a++
49+
print(a) --> 5
4550
```
4651

4752
## Comparison Chaining

0 commit comments

Comments
 (0)