Skip to content

Commit

Permalink
Document increment operator
Browse files Browse the repository at this point in the history
This got lost when the new operators section was merged into a single page.
  • Loading branch information
Sainan authored and well-in-that-case committed Nov 17, 2024
1 parent 9ba6107 commit a5d7427
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/New Operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ a += 1
Compound operators are syntactic sugar. They'll call the same metamethods as their non-compound counterparts.
:::

## Increment Operator
In addition to the compound operator `+=`, there is an even faster way to increment a value by 1 using the prefixed ++ operator:
```pluto
local a = 1
print(++a) --> 2
++a
print(a) --> 3
```

## Comparison Chaining
The `<`, `<=`, `>`, and `>=` operators can now be chained successively.

Expand Down

0 comments on commit a5d7427

Please sign in to comment.