/// /// var promotionRendered = { render: function (tips) { if (!tips) { return; } var result = ""; var arrayToProccess = _.isArray(tips) ? tips : [tips]; _.each(arrayToProccess, function (tip) { try { var compliedTemplate = _.template(tip.TipTemplate); result += compliedTemplate(tip.ViewData); } catch (e) { console.error(e); } }); return result; } }