我想知道为什么this.show会返回undefined,meanwhilte quiz.show将返回该函数。
此代码有效:
const quiz = {
//Generates the quiz
generateQuiz: () => {
quiz.resetQ();
quiz.generateRandomQuestions();
quiz.displayQuiz();
quiz.show();
},
返回undefined:
const quiz = {
//Generates the quiz
generateQuiz: () => {
this.resetQ();
this.generateRandomQuestions();
this.displayQuiz();
this.show();
},