when using an variable in ejs it shows alreadu 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
<% } %>