Array.some()
let result = products.filter(product => {
let matchBrand = s.hasOwnProperty("brands") && s.brands.includes(product.brand_id);
let matchParams = s.hasOwnProperty("params") &&
product.hasOwnProperty("params") &&
product.params.some(param => s.params.includes(param));
return matchBrand && matchParams;
});