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 Object-Oriented JavaScript (2015) Practice Project User Interface Code

Alex Flores
Alex Flores
7,864 Points

Having a tough time keeping up with all of the object passing... please help

I'm doing the object-oriented javascript module and I just finished making a quiz and it's got me disoriented. I tried it myself and couldn't get my code to work. I had something very, very different from what Andrew had.

When I read the code, I understand it just fine. It's kind of a pain trying to follow the flow of logic from function to function and trying to understand what object "this" is referring to, but I'm able to do it and the code makes complete sense to me. What I'm having a problem doing is, creating the code. I don't know what I'm asking here, but if anyone has any tips or pointers, I'd really appreciate it, because I'm feeling quite inadequate at this point..............

1 Answer

Steven Parker
Steven Parker
229,771 Points

It helped me to think of an "object" as a box. The box can contain variables (properties) and/or functions (methods).

Of course, you can have more than one of a certain kind of box. The word "this" just refers to "this particular box".

Does that help?

Alex Flores
Alex Flores
7,864 Points

ha not really. I actually understand that all very well - I think. I guess it's my planning skills that really stink, because when I'm writing this code, I just don't think of everything that I need to make the code work the way I want it to... I don't know if that makes sense.

I don't know, maybe it'll just take a lot of practice to think, but I feel like there should be some planning methodology commonly employed, but I haven't seen anything.