Javascript 如何在jade中连接数组?
我试图通过使用for循环将数组Javascript 如何在jade中连接数组?,javascript,pug,Javascript,Pug,我试图通过使用for循环将数组c[x].topLevelIndustry中的项连接起来: -var text=""; -var y; script. for (y=0, y< c[x].topLevelIndustry.length, y++){ text+=#{c[x].topLevelIndustry[y]} + ","; } p= text -var text=”“; -变量y; 剧本 对于(y=0,y
c[x].topLevelIndustry
中的项连接起来:
-var text="";
-var y;
script.
for (y=0, y< c[x].topLevelIndustry.length, y++){
text+=#{c[x].topLevelIndustry[y]} + ",";
}
p= text
-var text=”“;
-变量y;
剧本
对于(y=0,y
-var somevar
,那么如何使它对jade可用使用script标记可以防止帕格运行代码。相反,它被传递到浏览器以在客户端执行。使用脚本标记而不是脚本标记
-
var text = "";
var y;
for (y = 0, y < c[x].topLevelIndustry.length, y++){
text += c[x].topLevelIndustry[y] + ",";
}
p #{text}
p= c[x].topLevelIndustry.join()