You can loop over Objects and Arrays using the @each tag. The each tag's inner workings are similar to the JavaScript for of loop.

@each(user in users)
<li> {{ user.username }} </li>
@each((user, index) in users)
<li> {{ index + 1 }} {{ user.username }} </li>

Looping over objects

You can loop over JavaScript objects using the same @each tag. For example:

await edge.render('recipes', {
food: {
ketchup: '5 tbsp',
mustard: '1 tbsp',
pickle: '0 tbsp'
@each((amount, ingredient) in food)
<li> Use {{ amount }} of {{ ingredient }} </li>

Defining fallback content

The @each tag can be used with the @else tag to define fallback content in cases where the value is an empty array/object or undefined.

@each(comment in post.comments)
<p> This post has not received any comments </p>