ejs / javascript check if array/object exists and is not empty
snippet in javascript

ejs / javascript check if array/object exists and is not empty

user7295

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