Say I have a set of variables name1, name2, name3... etc, which I'm writing out in a div. Right now I can print it out using #{name1} #{name2} #{name3} etc but is it possible to do this with a for loop in Jade
- for(var i = 0; i<3; i++)
{
div #{"name" + i}
}
So i want the output to be:
div #{name1}
div #{name2}
div #{name3}
Something like this in order to print out the first 3 elements.... hope i made some sense. When I do it the way I have above Jade seems to think I'm just putting a string into the div instead of the variable. If it matters I'm using Express.JS for my application. ty