Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript Object-Oriented JavaScript (2015) Practice Project User Interface Code

My questions are not coming up in my browser. I am using chrome

i'm doing your Object-Oriented JavaScript final quiz project. here is a snapshot of my code https://w.trhou.se/6o7bcl5v7q

1 Answer

You'll need to check out your console in your developer tools to see what errors you're getting in Javascript, it's invaluable when figuring out why things aren't working.

In quiz_ui.js, you're missing two last curly braces at the very end, one for displayProgress: function() and another for var QuizUI.

See here -

displayProgress: function() {
    var currentQuestionNumber = quiz.currentQuestionIndex + 1;
    this.populateIdWithHTML("progress", "Question " + currentQuestionNumber + " of " +
quiz.question.length);
  }
}

In app.js you broke into a newline in your questions array, so it thinks the rest of that object is a string.

See here -

var questions = [
  new Question("Who was the first President of the United States?", [ "George Washington", "Thomas Jefferson" ], "George Washington"),
      new Question("What is the answer to the Ultimate Question of Life, the Universe, and Everything?", ["Pi","42"], "42")
];

I think that was it, it should run if you fix those two things. I was only able to find those errors by reading the console and checking the lines it gave, so be sure to check it out in the future. :)