📅  最后修改于: 2022-03-11 15:02:53.637000             🧑  作者: Mango
const filters = {forSale: true, color: 'blue'};
const filteredArray = array.filter(item => {
let result = true;
for(let key in filters) {
if (item[key] !== filters[key]){
result = false;
break;
}
}
return result;
})