title: Sort an array which contains number and strings
body: <p>I am trying to sort an array which contains strings, numbers, and numbers as strings (ex. '1','2'). I want to sort this array so that the sorted array contains numbers first and then strings that contain a number and then finally strings. </p>
  
  <pre><code>var arr = [9,5,'2','ab','3',-1 ] // to be sorted
  arr.sort()
  // arr = [-1, 5, 9, "2", "3","ab"] // expected result
  //arr = [-1, "2", 5, 9, "ab"] // actual result
  </code></pre>
  
  <p>I have also tried </p>
  
  <pre><code>var number =[];
  var char =[];
  arr.forEach(a=&gt;{
   if(typeof a == 'number') number.push(a);
   else char.push(a);
  })
  arr = (number.sort((a,b)=&gt; a&gt;b)).concat(char.sort((a,b)=&gt; a&gt;b))
  // arr = [-1, 5, 9, "2", "3","ab"] // expected result
  //  arr = [-1, 5, 9, "2", "ab", "3"]// actual result
  </code></pre>