How can I peform this filter but only check each condition if the value is not undefined
?
For example, if taxId
is undefined I want to ignore it instead of filtering by it.
this.subAgencies = demoSubAgencies.filter(function(subAgency) {
return subAgency.subAgencyName == agencyName
&& subAgency.taxId == taxId
&& subAgency.accountNumber == accountNumber;
});