Japid icon indicating copy to clipboard operation
Japid copied to clipboard

Break loop

Open alexbezhan opened this issue 12 years ago • 3 comments

Hi and thank you for great plugin. I faced the following issue. I have the 'for' loop and want to break it(use 'break' keyword) like following:

for Ingredient ingredient: ingredients ingredient.product.get(); if (_index < 4 || ingredients.size() == 4) {

  • ${ingredient.product.name}
  • } else if (_index == 4){ <li>...</li> } else { break; } `

    AFAIK 'for' loop generates render method callback. How can I break it ? Thanks.

    alexbezhan avatar May 15 '12 07:05 alexbezhan

    Sorry maybe it would be better to use gist for code example: https://gist.github.com/2699837

    alexbezhan avatar May 15 '12 07:05 alexbezhan

    You can use "return" instead, but do remember there must be no space between the "}" and "return".

    mayan31370 avatar May 15 '12 08:05 mayan31370

    Thanks much.

    alexbezhan avatar May 15 '12 15:05 alexbezhan