const find = (arr, parametres) => { for (let i = 0; i < parametres.length; i++) { let founded = false; for (let j = 0; j < arr.length; j++) { if ( arr[j].property1 === parametres[i].property1 && arr[j].property2 === parametres[i].property2 ) { founded = true; } } if (parametres[i].type === 'type1') { if (founded) { return false; } } if (parametres[i].type === 'type2') { if (!founded) { return false; } } } return true; }; |
actionandsubject- Igor