我正在遍历列表中的行 w/ $.each
,并在每一行上应用一组过滤器$.each
。我想跳过不匹配的行。它看起来像这样:
$.each(data, function(i, row) {
count = parseInt(row['n']);
year = row['year'];
if (options.filters) {
$.each(options.filters, function(filter, filtervalue) {
if (row[filter] != filtervalue) return true;
});
}
// Will only get here if all filters have passed
}
如果与给定的过滤器不匹配,如何让嵌套$.each
循环跳过该行?filtervalue