Foreach loop in jade (node.js template engine)

前端 未结 3 1770
星月不相逢
星月不相逢 2020-12-29 03:31

Ok, I am getting an associative array from node server and trying to render it in Jade. I obviously need a foreach loop, but nothing seems to work! I tried these both codes:

3条回答
  •  渐次进展
    2020-12-29 03:48

    Your second example would work except you have a small syntax error in it - an extra parentheses, it should be:

    - rows.forEach(function(item) {
      li= item
    - })
    

提交回复
热议问题