How to array of objects in template ejs?

后端 未结 4 1461
遥遥无期
遥遥无期 2021-01-12 18:57

I have a results variable that is an array of objects. I carry the results variable from my javascript file to my main route file. I am trying to render my page to display l

4条回答
  •  囚心锁ツ
    2021-01-12 19:28

    This will show list of id of your results, just change _id by your property of objects as you want to show.

     
      <% results.map((result)=>{ %>
    • <%= result._id %>
    • <% }) %>

提交回复
热议问题