title: Why am i getting error of "cannot set property of undefined"?
body: <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>  const quiz = new quiz(questions);
  
    populate();
  
    function Question(text, choices, answer){
      this.text = text;
      this.choices = choices;
      this.answer = answer;
    }
    
    Question.prototype.correctAnswer = function(choices){
      return choice === this.answer;
    }
  
    function Quiz(questions){
      this.score = 0;
      this.questions = questions;
      this.questionIndex = 0;
    }
    
    quiz.prototype.getQuestionIndex = function(){
      return this.questions[this.questionIndex];
    }
    
    quiz.prototype.isEnded = function(){
      return this.questions.length === this.questionIndex;
    }
    
    quiz.protype.guess = function(answer){
      this.questionIndex++;
    
      if(this.getQuestionIndex().correctAnswer(answer)){
        this.score++;
      }
    }</code></pre>
  </div>
  </div>
  </p>
  
  <p>When I run this code, it says it cannot set 'getQuestionIndex' to undefined. But didn't Ique set it to 0? I set this.questionIndex to 0 in my Quiz constructor. What am I missing here?</p>