<% _.each(companies, function(company){ %> <% checked = '' %> <% if (_.isArray(usedCompanyIds) && usedCompanyIds[company.id]) { %> <% checked = 'checked' %> <% } %> <% }); %> <% if (totalProducts) { %> <% } %>