## 6.2.1.2 Logic and Iteration

Using the `<% %>` syntax you can of course embed loops and so on using this syntax:

    <html>
       <body>
          <% [1,2,3,4].each { num -> %>
             <p><%="Hello ${num}!" %></p>
          <%}%>
       </body>
    </html>

As well as logical branching:

    <html>
       <body>
          <% if(params.hello == 'true' )%>
          <%="Hello!"%>
          <% else %>
          <%="Goodbye!"%>
       </body>
    </html>