<% if(typeof papers == 'object' && papers.length > 0){ %> // whatever you want to do with 'papers' array <% } %>