Q: Conditions met but function not being called (Basic JavaScript) I'm trying to put together a simple quiz to develop my basic JS skills, and it's all working ok, except for the 'endQuiz' function which for some reason isn't working. 
As far as I can see, the conditions are being met but the function 'endQuiz' still isn't being called.
Any ideas why?
JSFiddle: http://jsfiddle.net/HVLvQ/ (gets to end of quiz and won't call endQuiz()) 
Here's the if statement
if (qNum === quizLength && isQuestion === false) {
    endQuiz();
}

and here's the function I want that to call:
function endQuiz() {
     questionBox.innerHTML = '<h1>Final Score:</h1>';
     answerBox.innerHTML = '<h2>' + score + ' out of ' + allQuestions.length + '</h2>';
     qNum = 0;
     score = 0;
}


A: You were trying to read correctAnswer from undefined in checkAnswer(). 
Alter your checkAnswer() function so it checks if the question exists.
function checkAnswer() {

    if (allQuestions[qNum] == undefined) {
        return;
    }

    ...
}

And it will work.
