-
Notifications
You must be signed in to change notification settings - Fork 0
Tag: for
Chris Talman edited this page Aug 29, 2016
·
4 revisions
The for
tag allows use of any kind of JavaScript for
statement.
While the each
tag is appropriate in most cases, the for
tag allows greater autonomy in cases where greater complexity is required.
{{for expression}}
contents
{{/for}}
{{for i = 0; i < 3; i++}}
{{print i}}
{{/for}}
This would output the following.
0
1
2
{{for i of array}}
{{print i}}
{{/for}}
This would output the following given data object {array: ['a', 'b', 'c']}
.
a
b
c