title: Sorting Array using JavaScript/jQuery
body: <p>I have an array as shown below:</p>
  
  <pre><code>var fruits = ['0-2','1-1','12-2','14-2','2-3','21-1','4-1'];
  </code></pre>
  
  <p>It gives me output like this:</p>
  
  <p><code>0-2,1-1,12-2,14-2,2-3,21-1,4-1</code>.</p>
  
  <p>I want to sort this array and get output as: </p>
  
  <p><code>0-2,1-1,2-3,4-1,12-2,14-2,21-1</code> using JavaScript/jQuery.</p>
  
  <p>I tired using <code>fruits.sort();</code> but that does not work, any suggestions?</p>