First, thanks to those that helped with my previous problem with the project.
So I’ve worked my way up into Chapter 11 and made the project changes randomizing the questions selecting an answer from a list. And I get errors. So I got the source from https://github.com/spbooks/jsninja1/ and tried it. Same errors!
First error is ‘Uncaught TypeError: Cannot set property ‘asked’ of undefined’ on
function ask(question) {
console.log(“ask() invoked”);
// set the question.asked property to true so it’s not asked again
question.asked = true; <–ERROR ON THIS LINE
update($question,quiz.question + question.question + “?”);
Second error is ‘Uncaught TypeError: Cannot read property ‘answer’ of undefined’ on
function check(answer) {
console.log("check() invoked");
if(answer === question.answer){ <--ERROR ON THIS LINE
update($feedback,"Correct!","correct");
Have to admit I’ve got to read this chapter again. Callbacks, closres and currying…oh my! Perhaps too may topics in this one.
Thanks for helping a novice!
Dan