Loop in Jade (currently known as "Pug") template engine

Huy Tran picture Huy Tran · Jan 4, 2012 · Viewed 113.5k times · Source

I want to use a simple loop like for(int i=0; i<10; i++){}.

How do I use it in the Jade engine? I'm working with Node.js and use the expressjs framework.

Answer

qiao picture qiao · Jan 4, 2012

for example:

- for (var i = 0; i < 10; ++i) {
  li= array[i]
- }

you may see https://github.com/visionmedia/jade for detailed document.