On the EJS github page, there is one and only one simple example: https://github.com/visionmedia/ejs
Example
<% if (user) { %> &
For your if statement you need to use typeof:
if
typeof
<% if (typeof user == 'object' && user) { %> <% } %>