Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Problems with Object-Oriented JavaScript

I have been having problems with Object-Oriented JavaScript and I was hoping you could help me out. When I originally went through the course I struggled with the concept and decided I would come back to it. I did exactly that and have gone through the entire course all over again. I was able to not only understand the syntax better, but I was able to go through most challenges on my own. All but one.

The very last challenge to create a quiz has eluded me. I have created quiz apps before, but when it comes to creating one through OOJ I go blank. I am able to read through the teacher's code and understand what is what and why. But for some reason I can't create OOJ myself. I know this is a bit of an abstract problem, but I'm wondering if anyone has had this problem and if any of you could give me any advice that will help me construct OOJ better. I have learned so much but this remains to be a mystery as to why I can't build the quiz.

2 Answers

Steven Parker
Steven Parker
243,656 Points

Are you having specific issues completing a task?

You could show your code and provide a link the the course page you are working with, and someone could help with specific issues you may be having.

Otherwise, the best generic advice I can think of is to just consider objects to be "boxes" that hold other stuff. For example, in a quiz app, each question may be a "box" that holds the wording of the question, some number of possible answers, and something that indicates which of the possible answers is correct. This would make it convenient to pass the single object to a function that would ask the question, get the user's answer, and determine if it was correct.

Hello Steven, Thank you for taking the time to try and assist me with this. I know it was a bit of a weird question. I would share my code but I had a friend assist me with that and set me on the right course.

Thank you again though.