I have a page that makes a foreach and show some photos like this
<% imgs.forEach(function(img) { %>
/s
The shorthand version is correct, but it does have a syntax error
<%= role === 'admin' ? 'Super Admin' : 'Admin' %>
Or
<% if(role === 'admin'){ %>
<p>Super Admin</p>
<% } else{ %>
<p>Admin</p>
<% } %>
Something like this:
<% if(imgs.length > 0){ %>
<% imgs.forEach(function(img) { %>
<img src="uploads/<%=user.username%>/screenshots/<%= img %>">
<% }); %>
<% } else{ %>
<p>no photos uploaded</p>
<% } %>
Reference
Yes , Here is short hand version :
<%= role == 'A' ? 'Super Admin' : ? 'Admin' %>