You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, sure...
While it's a good idea, you need at least includes + if's and for's loops that contain html blocks...
<%include ../navigation.ejs%>
<table>
<% for (let i in candlist) { %>
<tr>
<td><%= candlist[i].count %></td>
<td><%= candlist[i].firstname %> <%= candlist[i].name %></td></tr>
<% } %>
</table>
Johan.
I'm looking to create include possibility without decrease a lot of performance :-)
for loops you can do this :
/////////////<%include ../navigation.ejs%>///////////still not good included
<table>
${candlist.map(cand=>`
<tr>
<td>${cand.count}</td>
<td>${candl.firstname} ${cand.name}</td>
</tr>
`).join('\n')}
</table>
Template Literal is fastest, smallest and simplest template engine, because it use JS's literal template feature.
It's 55 times faster than EJS, and it also use less CPU and RAM ressources, so it may be a good idea to use it instead of EJS 😀
The text was updated successfully, but these errors were encountered: