docs: add comment about for else and break

This commit is contained in:
Shritesh Bhattarai 2019-06-08 12:49:56 -07:00 committed by Andrew Kelley
parent 5784631fab
commit 404e4b0268

View File

@ -3293,6 +3293,7 @@ test "for else" {
var items = []?i32 { 3, 4, null, 5 };
// For loops can also be used as expressions.
// Similar to while loops, when you break from a for loop, the else branch is not evaluated.
var sum: i32 = 0;
const result = for (items) |value| {
if (value == null) {