getting undefined value in EJS when value is defined code example
Example: ejs / javascript check if array/object exists and is not empty
<% if(typeof papers == 'object' && papers.length > 0){ %>
// whatever you want to do with 'papers' array
<% } %>