title: Count number of entries of a minimum or maximum value of a parameter in Javascript
body: <p>I want to count number of occurrences of minimum value or maximum in an array in JS and remove the elements from original one if number of occurrences are more than 2(example). For example, I have below object:</p>
  <pre><code>let data = [
      {name: 'DataSet01', Severity:'5'},
      {name: 'DataSet02', Severity:'3'},
      {name: 'DataSet03', Severity:'2'},
      {name: 'DataSet04', Severity:'2'},
      {name: 'DataSet05', Severity:'3'}
      {name: 'DataSet06', Severity:'2'}
  ];
  </code></pre>
  <p>Here, Severity is the key and it's value '2' is the minimum among all and it occurred 3 times and I want to remove all entries with severity 2 from original array (data).</p>
  <p>So Updated object should look like :</p>
  <pre><code>let finaldata = [
      {name: 'DataSet01', Severity:'5'},
      {name: 'DataSet02', Severity:'3'},
      {name: 'DataSet05', Severity:'3'}
  ];
  </code></pre>
  <p>So far, I tried with filter to find minimum, slice but not able to get desired results on this one. Hope some one can help me on this .</p>