title: JavaScript Dice Game is returning 0
body: <p>There are many posts on Stack Overflow about JavaScript dice games, but I could not find one that answers my question.  This code is adapted from CodeCademy:</p>
  
  <pre><code>function rollSingleDice() {
      return Math.floor(Math.random()*6+1);
  }
  
  function rollDice(player) {
  var score = 0;
  var roll1; var roll2;
  var playerScore = player.getScore();
      do {
          roll1 = rollSingleDice();
          roll2 = rollSingleDice();
      } while (roll1 === roll2);
  
      score = roll1 + roll2;
      player.addToScore(score);
  
      if (roll1 === roll2) {
          console.log(player.name + "'s current score is: " +
          playerScore);
      } else {
          console.log(player.name + "'s current score is: " +
          playerScore);
      }
     // return score;
  }
  
  
  function Player(name) {
    this.name = name;
    var score = 0; // this is a private attribute
    this.addToScore = function(points) {
      score = score + points;
    };
    this.getScore = function() {
      return score;
    };
  }
  
  var player1 = new Player("Bobby");
  rollDice(player1);
  </code></pre>
  
  <p>I have modified the <code>do ... while</code> loop several times and the only output I get is the following:</p>
  
  <p><code>Bobby's current score is: 0</code></p>
  
  <p>Could someone please point me in the right direction?  Thank you.</p>