You cannot pass a for a loop code as second parameter to the res.render
call. The parameter should be a valid JSON. But you can always do
var obj = {};
// Here you can loop to manipulate and add data to obj
// or even
obj.key1 = "val1";
obj.array1 = [1,2,3];
obj.obj1 = {key:1};
res.render('preview', obj);
and in preview.jade
template you can loop over and display the elements of obj