title: Javascript .pop() and .sort() not working right in a for loop
body: <p>I'm trying to remove the last element in the array but it ends up putting the removed element back to the top of the list and some of the other elements are listed differently. </p>
  
  <p>Same thing using the .sort() method. The output shows this sentence five times:
  Tolstoy wrote War and Peace,Twain wrote Huckleberry Finn</p>
  
  <pre><code>var author_title = new Array(5)
  author_title[0]="Tolstoy wrote War and Peace";
  author_title[1]="Twain wrote Huckleberry Finn";
  author_title[2]="Hardy wrote The Return of the Native";
  author_title[3]="Dickens wrote A Christmas Carol";
  author_title[4]="Uris wrote Exodus";
  
  for(var count=0;count&lt;author_title.length;count++) {
  document.write(author_title.pop() + "&lt;br&gt;");
  }
  
  for(var count=0;count&lt;author_title.length;count++) {
  document.write(author_title.sort()+"&lt;br&gt;");
  }
  </code></pre>