title: Why A and B are equal after sort()?
body: <pre><code>function randOrd() {
      return (Math.round(Math.random()) - 0.5)
  }
  
  A = [0,1,2,3,4,5,6,7]
  var B = A.sort(randOrd)
  console.log('A=',A)
  console.log('B=',B)
  </code></pre>
  
  <hr>
  
  <p>output:</p>
  
  <pre><code>a= [ 3, 4, 0, 1, 6, 2, 5, 7 ]
  b= [ 3, 4, 0, 1, 6, 2, 5, 7 ]
  </code></pre>
  
  <p>I expected <code>a</code> to be the original array and <code>b</code> to be sorted. But they are both equal (sorted), why?</p>