numeric array sort()
<p>Is this part from the book "Learning PHP, MySql and Javascript by. Robin Nixon" wrong?</p>

<pre><code>numbers = [7, 23, 6, 74];

numbers.sort(function(a,b){return a - b});
</code></pre>

<p>output is 6,7,23,74</p>

<p>The book says:</p>

<blockquote>
  <p>If the anonymous function inside sort() returns a value greater than zero, the sort assumes <strong>a</strong> comes before <strong>b</strong>.</p>
  
  <p>If the anonymous function inside sort() return a value less than zero, the sort assumes <strong>b</strong> comes before <strong>a</strong>.</p>
  
  <p>The sort runs this function across all the values in the array to determine their order.</p>
</blockquote>

<p>is this wrong? Because....</p>

<p><code>a</code> here is <code>7</code><br>
<code>b</code> here is <code>23</code></p>

<p><code>7 - 23 = -16</code> // a number less than zero. Book says it should b comes before a.</p>

<p>so the final output should be <code>74, 23, 7, 6</code></p>
