Javascript 如何在下一个翻译EJB中迭代数组

Javascript 如何在下一个翻译EJB中迭代数组,javascript,arrays,object,ejs,i18next,Javascript,Arrays,Object,Ejs,I18next,我已经用i18next实现了翻译, 我试图在前端迭代嵌套数组,但在转换模式下不工作,请帮助 en.json { "title": "List of Countries", "list":[{ "name": "Singapore", "code": "SG" },{ "name": "Thailand", "code": "TH" }] } index.ejs <h2><%=t("list.0.name")%><

我已经用i18next实现了翻译, 我试图在前端迭代嵌套数组,但在转换模式下不工作,请帮助

en.json

{
  "title": "List of Countries",
  "list":[{
     "name": "Singapore",
     "code": "SG"
  },{
    "name": "Thailand",
    "code": "TH"
 }]
}


index.ejs

<h2><%=t("list.0.name")%></h2> //working fine

//using map not working

<% t("list").map(e=>{%>
  <a href="#"><%=t(e.name)%></a>
<%})%>

//工作正常
//使用地图不起作用
{%>

它是如何“不工作”的?@Phil am出现以下错误
无法读取未定义的属性“map”
它是如何“不工作”的?@Phil am出现以下错误
无法读取未定义的属性“map”