title: Creating a leaderboard in HTML/JS
body: <p>I'm trying to create a top 10 leaderboard, for now, I've only implemented 3 players, but I'm coming across an issue. My script doesn't seem to be outputting anything on webpage.</p>
  
  <p>The purpose of the script is to compare 3 arrays, player1,player2,and player3 solely based off of score. Which is the 2nd index of each array. I want the script to list the players in order of highest score. </p>
  
  <p>This method doesn't really seem to be efficient, especially when I'll have to add 7 more players. Could someone suggest perhaps an easier approach, as well as show me why my script wont output the info.</p>
  
  <p>Here's the JS</p>
  
  <pre><code>function leaderboard() {
  var player1 = {name:"Thomas",date:"01/23/18",score:"201"};
  var player2 = {name:"Michael",date:"03/24/17",score:"943"};
  var player3 = {Name:"Lisa",date:"06/04/18",Score:"79"};
  
  if(player1[2]&gt;player2[2])&amp;&amp;(player1[2]&gt;player3[2]) {
      document.write(player1);
      if(player2[2]&gt;player3[2]) {
          document.write(player2);
          document.write(player3);
      }
      else {
          document.write(player3);
          document.write(player2);
      }
  }
  else if(player2[2]&gt;player1[2])&amp;&amp;(player2[2]&gt;player3[2]) {
      document.write(player2);
      if(player1[2]&gt;player3[2]) {
          document.write(player1);
          document.write(player3);
      }
      else {
          document.write(player3);
          document.write(player1);
      }
  
  }
  else if(player3[2]&gt;player2[2])&amp;&amp;(player3[2]&gt;player1[2]) {
      document.write(player3);
      if(player1[2]&gt;player2[2]) {
          document.write(player1);
          document.write(player2);
      }
      else {
          document.write(player2);
          document.write(player1);
      {
      }
  }
  }
  </code></pre>
  
  <p>Here's my html</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;div id="container"&gt;
  &lt;script src = "topten.js"&lt;/script&gt;
   &lt;script&gt;
   leaderboard();
   &lt;/script&gt;
  &lt;link rel="stylesheet" type="text/css" href="/css/topten.css"&gt;
  &lt;/html&gt;
  &lt;/body&gt;
  </code></pre>