Skip to content

Instantly share code, notes, and snippets.

@alexbezhan
Created May 15, 2012 07:53
Show Gist options
  • Save alexbezhan/2699837 to your computer and use it in GitHub Desktop.
Save alexbezhan/2699837 to your computer and use it in GitHub Desktop.
Play japid break in for loop
`for Ingredient ingredient: ingredients
`ingredient.product.get();
`if (_index < 4 || ingredients.size() == 4) {
`${ingredient.product.name}
`} else if (_index == 4){
<li>...</li>
`} else {
`break;
`}
`
@branaway
Copy link

Currently break does not work in open for loops, neither does continue. The return hack in the above sample works like a "continue".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment