0
我有以下的underscore.js模板。我想檢查數組值是否等於pubHols數組中的日期。這是什麼語法?Underscore.js檢查數組值是否等於另一個數組中的項
var pubHols = [
{ date: '2015-12-25', title: 'Christmas Day' },
{ date: '2015-12-28', title: 'Boxing Day' },
];
<% _.each(days, function(day) { %>
<% if(day.date == pubHols.date){ %>
<div class="pubHol"><span class="day-number"><%= day.day %></span></div>
<% } %>
<% }); %>