File: looping.utml

package info (click to toggle)
node-utml 0.2.0~gite9f7c3d-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 112 kB
  • ctags: 14
  • sloc: makefile: 2; sh: 2
file content (22 lines) | stat: -rw-r--r-- 368 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<html>
<head>
  <title>UTML - Looping</title>
</head>
<body>
  <h1><%= title %></h1>
  
  <h2>'for' loop</h2>
  <ul>
    <% for(var i = 0; i < people.length; i++) { %>
      <li><%= people[i] %></li>
    <% } %>
  </ul>
  
  <h2>Underscore's .each</h2>
  <ul>  
    <% _.each(people, function(name){ %>
      <li><%= name %></li>
    <% }); %>
  </ul>
</body>
</html>