title: Javascript arranging in ascending order not working
body: <p>I was trying sorting numbers in ascending order using javascript and i am stuck. 
  HTML:
  </p>
  
  <pre><code>&lt;h2&gt;JavaScript Array Sort&lt;/h2&gt;
  
  &lt;p&gt;Click the button to sort the array in ascending order.&lt;/p&gt;
  
  &lt;button onclick="myFunction()"&gt;I will arrange&lt;/button&gt;
  
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>JS: </p>
  
  <pre><code>var points = [7, 1, 6, 3, 5, 2];
  document.getElementById("demo").innerHTML = points;    
  
  function myFunction() {
      points.sort(function(a, b){return a - b});
      document.getElementById("demo").innerHTML = points;
  }
  </code></pre>
  
  <p>js fiddle link: <a href="https://jsfiddle.net/djmayank/uef3xexk/" rel="nofollow noreferrer">https://jsfiddle.net/djmayank/uef3xexk/</a> <br>
  I am not getting my mistake. Any kind of help is appreciated.</p>