node.js - For loop in Swig template engine -


I am using as a template engine for express.js and I have no way of making a loop with a variable Not found therefore:

 for  (var i = 0; i & lt; 100; i ++) {// whatever}  

Is this also possible?

As you have posted, such loops are not present in swig, But repeat again, though (see).

Otherwise, you can make a range assistant, as discussed

  swig.setDefaults ({local: {range: function (start, len) { Return (new) (). Partition (','). Map (function (n, idx) {return idx + start;}}}}}});  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -