← Back to context

Comment by mg

7 days ago

Hyper syntax:

    <tr :for="user of users">
        <td>${ user.name  }</td>
        <td>${ user.email }</td>
        <td>${ user.age   }</td>
    </tr>

EJS syntax:

    <% for (user of users) { %>
        <tr>
            <td><%= user.name  %></td>
            <td><%= user.email %></td>
            <td><%= user.age   %></td>
        </tr>
    <% } %>

I prefer EJS, because all you need to know is "<% begins JS" and "%> ends JS". Everything else is just plain HTML and JS.

The EJS website: https://ejs.co

Why not just embed html templates in js at this point? Why js in html?