what sorting algorithm should be used when dealing with strings, numbers or both in javascript?
<p>I find this really intriguing.</p>

<p>When- <code>var x = [1, 50, 2, 4, 2, 2, 88, 9, 10, 22, 40];</code></p>

<p>Then <code>x.sort();</code> will <strong>not</strong> sort properly</p>

<p>When <code>var x = ["dog","apple","zebra","cow"];</code> , <code>x.sort();</code>
will sort properly.</p>

<p>what is the proper function to sort them in one call?</p>
