Skip to content

Commit

Permalink
Merge pull request #306 from ckd/master
Browse files Browse the repository at this point in the history
example for loop vars
  • Loading branch information
tanner0101 committed Apr 25, 2018
2 parents 2750a47 + bb201f8 commit 994422d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions 3.0/docs/leaf/basics.md
Expand Up @@ -155,6 +155,13 @@ Leaf provides some extra variables inside a `#for` loop to give you more informa
- The `loop.isLast` variable is true when it's the last iteration.
- The `loop.index` variable will be set to the number of the current iteration, counting from 0.

Here's how we could use a loop variable to print just the first name in our array:

```
#for(name in team) {
#if(isFirst) { <p>#(name) is first!</p> }
}
```

### Embedding templates

Expand Down

0 comments on commit 994422d

Please sign in to comment.