title: Eliminate immediate array values using Javascript
body: <p>I'm working on project where I have array simmilar to this </p>
  
  <pre><code>var sortBp = [ 'height58em', 'width480px', 'width767px', 'width768px', 'width959px' ];
  </code></pre>
  
  <p>I want to eliminate any immediate numbers array &amp; only show higher number between them</p>
  
  <p>for example, from above array <code>width767px</code> &amp; <code>width768px</code> are immediate numbers array. </p>
  
  <p>I want to eliminate <code>width767px</code> &amp; keeping <code>width768px</code> as it is higher number.</p>
  
  <p>So final result will be </p>
  
  <pre><code>var sortBp = [ 'height58em', 'width480px', 'width768px', 'width959px' ];
  </code></pre>
  
  <p>Is that possible with pure javascript function ??</p>
  
  <p>EDIT :</p>
  
  <p>I have sorted array using follwoing function but I'm not clear how to remove immediate array.</p>
  
  <pre><code>  var sortBp = bpArrays.sort(function(a, b) {
                      a = a.replace(/[a-z]/g, '');
                      b = b.replace(/[a-z]/g, '');
                      return a - b;
                  });
  </code></pre>