NodeJs and Ejs Pass Arrays to page
问题 I am trying to pass an array to an .ejs page, however when I try use var test ="<%= data %>"; console.log(test); I get the output [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object Console.log on the nodejs file works fine, but its when I try console.log client side it messes up. 回答1: The issue is likely with <%= data %> , rather than console.log() . If you check the result client-side, you'll probably see: var test =