So I get SyntaxError: Unexpected token { on line "Question.prototype.displayQuestion() { ". But code looks fine. Anyone know what is going on?
function Question(question, answers, correct){
this.question = question;
this.answers = answers;
this.correct = correct;
}
Question.prototype.displayQuestion(){
console.log(this.question);
for(var i=0; i<this.answers.length; i++){
console.log(i + " : " + this.answers[i]);
}
}