From c9034a0485186e2b8a5c36ae9c4d4e50007da390 Mon Sep 17 00:00:00 2001 From: Michael Lamb Date: Mon, 21 Nov 2016 11:57:52 +1100 Subject: [PATCH] Add break statement to cheatsheet.md Added information about the existence of the break statement to the loop section. --- cheatsheet.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cheatsheet.md b/cheatsheet.md index 3a22508..6bde03f 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -313,6 +313,15 @@ while (some_condition()) { /* do something */ } for (x : [1,2,3]) { print(i); } ``` +Each of the loop styles can be broken using the `break` statement. For example: + +``` +while (some_condition()) { + /* do something */ + if (another_condition()) { break; } +} +``` + ## Conditionals ```