Skip to content Skip to sidebar Skip to footer

The Difference Between <%=, <% And <%- In Ejs

As I wrote in the title. In Ejs what's the difference between <%=, <% and <%-? for example I saw this code <% include ../partials/header.ejs %>, and then there is th

Solution 1:

The following is from ejs docs (tag section):

  • <% 'Scriptlet' tag, for control-flow, no output
  • <%= Outputs the value into the template (HTML escaped)
  • <%- Outputs the unescaped value into the template

See the difference between escaped and unescaped html here

Post a Comment for "The Difference Between <%=, <% And <%- In Ejs"