Handlebars.registerHelper('times', function(n, block) { var accum = ''; n = parseInt(n) + 1; //so the loop started at 1 for(var i = 1; i < n; i++) accum += block.fn(i); return accum; });