所以基本上我知道你可以用这两种方法中的任何一种来循环数组。for(i in testarray)console.log(testarray[i]);for(var i=0;i<testarray.length;i++) console.log(testarray[i]);我的问题是如何复制/模拟该数组。同时支持两种for循环方法?因为当我做同样的事情,但是我创建了自己的函数,它在第一个for循环中包含了长度。
function emulat
具体来说,我想调用{% if typeof(myvar) == "boolean" %}或{% set a = parseInt(myvar) %},但是现在它给出了这个错误:
(/home/aidan/Desktop/nodejs/turbo/node_modules/swig/lib/swig.js:465:11) (/home/aidan/Desktop/nodejs/turbo/node_modules/swig/lib/swig.js:560:16) at Function.exports.swig.render (/home/aidan/Desktop/nodej