ordering array of numbers returns invalid result : <p>For some reason, sort doesnt sort correctly. Why is that?</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>console.log(
  [0,0,0,0,1,0,0,0,3,0,0,0,0,0,1,1,0,2,1,1,0,0,0,0,0,0].sort((a,b)=&gt;a&lt;b)
)</code></pre>
</div>
</div>
</p>

<p>But the inverse works....</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>console.log(
  [0,0,0,0,1,0,0,0,3,0,0,0,0,0,1,1,0,2,1,1,0,0,0,0,0,0].sort((a,b)=&gt;a&gt;b)
)</code></pre>
</div>
</div>
</p>
