if statement in ejs

JavaScript
<% if (user) { %>
  <h2><%= user.name %></h2>
<% } %>
Source

Also in JavaScript: