Skip to content

Commit c83fcef

Browse files
authored
fix: Update mutation guide (#265)
1 parent c222196 commit c83fcef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/guide/mutation.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,14 @@ count /= 25
4040
print(count) // 2
4141
```
4242

43-
These operators also return the assigned result, so you can use the new value immediately.
43+
These operators return `void` to help alleviate ambiguity and make code easier to understand—use the name of the binding to get its current value.
4444

4545
```grain
4646
let mut count = 7
4747
48-
print(count += 9) // 16
48+
print(count += 9) // void
49+
50+
// Instead, use
51+
count += 9
52+
print(count) // 25
4953
```

0 commit comments

Comments
 (0)