Fixed: EJS Loop #453

This commit is contained in:
Fechin committed 2024-02-26 17:50:58 +08:00
1 parent 0a8be31bc3
commit 423fab8bda
1 file changed
+5 -5
+5 -5
View File
@@ -162,11 +162,11 @@ Docs {.cols-3}
### Using loops
```html
<% if (userLoggedIn) { %>
<p>Welcome, <%= username %>!</p>
<% } else { %>
<p>Please log in.</p>
<% } %>
<ul>
<% for(i=0; i < users.length; i++) { %>
<li> <%= users[i].username %> </li>
<% } %>
</ul>
```