title: How to sort an array of integers correctly
body: <p>Trying to get the highest and lowest value from an array that I know will contain only integers seems to be harder than I thought.</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>var numArray = [140000, 104, 99];
  numArray = numArray.sort();
  console.log(numArray)</code></pre>
  </div>
  </div>
  </p>
  <p>I'd expect this to show <code>99, 104, 140000</code>. Instead it shows <code>104, 140000, 99</code>. So it seems the sort is handling the values as strings.</p>
  <p>Is there a way to get the sort function to actually sort on integer value?</p>