Forum Moderators: open
Cars.filter(function(car) {
return car.get('make') == 'Honda' || car.get('make') == 'Toyota';
});
var filterAttributes = [];
// As user selects values, add or remove them to this array:
filterAttributes.push({
attr: 'make',
val: 'Honda'
});
Cars.filter(function(car) {
for (var i = 0; i < filterAttributes.length; i++) {
if (car.get(filterAttributes[i].attr) === filterAttributes[i].val) {
return true;
}
}
// If you get here, none of the attributes matched
return false;
});