title: How to sort an array of floats in JavaScript?
body: <p>I tried below example but now working with correct information.</p>
  
  <pre><code>var fruits = [110.111, 1245.22222, 2.458, 0.001];
  fruits.sort();
  document.write(fruits);
  </code></pre>
  
  <p>Result : </p>
  
  <pre><code>0.001,110.111,1245.22222,2.458
  </code></pre>
  
  <p>But I want something like this</p>
  
  <pre><code>0.001,2.458,110..111,1245.22222
  </code></pre>
  
  <p>What wrong with this code?</p>