Can anyone say why this error occurred? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

Can anyone say why this error occurred?

var Question = function(question, answers, correct) { this.question = 'question'; this.answers = 'answers'; this.correct = 'correct'; } Question.prototype.displayQuestion() { console.log(this.question) }

29th Jan 2018, 4:30 PM
ANSHIF BABU AS
2 Réponses
+ 1
anyonr
29th Jan 2018, 4:30 PM
ANSHIF BABU AS
0
Let me know if this is what you are trying to get at. var Question = function(question,answer,correct) { this.question = question; this.answer = answer; this. correct = correct; } var question1 = new Question("Is the sky blue","Yes"); Question.prototype.displayQuestion = this. Question; console.log(question1);
30th Jan 2018, 6:22 AM
HazeDev