Compare multiple values of an array in the same time in Javascript As of now the below code working As expected. But in future if the newFilterArr have new record again I want to reedit this functionality. So how to overcome this?

function Optimiz() {
    let courseFilter = this.newFilterArr.find(k =&gt; k.key === 'courseId'),
        rateTypeFilter = this.newFilterArr.find(k =&gt; k.key === 'rateTypeId');

    this.rateSetupDataUI = this.originalRateSetupDataUI.filter(x =&gt; {
        if (courseFilter &amp;&amp; rateTypeFilter) {
            return x['courseId'] === courseFilter.filtered.id &amp;&amp; x['rateTypeId'] === rateTypeFilter.filtered.id;
        } else if (courseFilter &amp;&amp; !rateTypeFilter) {
            return x['courseId'] === courseFilter.filtered.id
        } else if (!courseFilter &amp;&amp; rateTypeFilter) {
            return x['rateTypeId'] === rateTypeFilter.filtered.id;
        }
    });
}
let courseFilter = this.newFilterArr.find(k =&gt; k.key === 'courseId'),
    rateTypeFilter = this.newFilterArr.find(k =&gt; k.key === 'rateTypeId');


I would consider making your filter an object instead of an array. The keys are probably unique and known ahead of time, thus could be a type.

    if (courseFilter &amp;&amp; rateTypeFilter) {
        return x['courseId'] === courseFilter.filtered.id &amp;&amp; x['rateTypeId'] === rateTypeFilter.filtered.id;
    } else if (courseFilter &amp;&amp; !rateTypeFilter) {
        return x['courseId'] === courseFilter.filtered.id
    } else if (!courseFilter &amp;&amp; rateTypeFilter) {
        return x['rateTypeId'] === rateTypeFilter.filtered.id;
    }


This code is a good example of a function doing too many things. You can just progressively filter, filtering by courseId first, and whatever results from that, you filter with rateTypeId.  The condition with the &amp;&amp; is not necessary. 

This could be rewritten as:

class Filter {
  courseId:string
  rateTypeId:string
}

function Optimiz() {
  const filter:Filter = this.newFilterObj

  // Match only if filter is a truthy value. Otherwise, just add it.
  this.rateSetupDataUi = this.originalRateSetupDataUI
    .filter(x =&gt; filter.courseId ? x.courseId === filter.courseId : true)
    .filter(x =&gt; filter.rateTypeId ? x.rateTypeId === filter.rateTypeId : true)
}


Nitpicks


I advise against a single let/var/const and recommend a let/var/const per variable. Prepending/appending requires needlessly modifying the first and last lines, respectively. And if you move variables around, you will still have to add let/var/const.
x['courseId'] and x['rateTypeId'] don't need to be in bracket notation, as the property names don't have invalid characters.