JavaScript
- 1 ответ
- 0 вопросов
1
Вклад в тег
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;
});