| 1 | <h2>Full example</h2> |
| 2 | <pre><code><h1>Let's have fun!</h1> |
| 3 | <% |
| 4 | const fruits = ["Apple", "Pear", "Orange", "Lemon"]; |
| 5 | const random = Array.from({ length: 198 }).map(x => Math.random()); |
| 6 | %> |
| 7 | |
| 8 | <p>These fruits are amazing:</p> |
| 9 | <ul><% for (const fruit of fruits) { %> |
| 10 | <li><%=fruit%>s</li><% } %> |
| 11 | </ul> |
| 12 | |
| 13 | <p>Some random numbers:</p> |
| 14 | |
| 15 | <% random.forEach((c, i) => { |
| 16 | %> <%- c.toFixed(10) + ((i + 1) % 6 === 0 ? " <br>\n": "") %><%});%></code></pre> |