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

c# - SignalR: "Protocol error: Unknown transport." when navigating to hub -

class - Kivy: how to instantiate a dynamic classes in python -

java - Algorithm negotiation fail SSH in Jenkins -