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) Constructor Functions and Prototypes Making the UI Work

Christopher Denny
Christopher Denny
10,460 Points

Is it just me?

Or is this and the previous video absolutely impossible to follow? I'm sitting here pausing every 5 seconds to figure out what he typed and why...Andrew, you rock, but I can't understand any of what's going on this project.

jrabello
jrabello
17,917 Points

Hello Christopher,

Don't worry about getting confused, if things are unclear I recommend you trying to follow the javascript track from the beginning, if you start with the basic courses things becomes more clear on this one

liktid
liktid
6,387 Points

its not just you. its very hard to follow and i did the basics course and the loops, arrays and objects course before. i think its just a very bad example because the code is presented very quick and all of it at once, while other course introduced it bit by bit. it would be better if he would follow the approach the other javascript instructor is doing: write small pieces of code and test it, so the student can follow the purpose of it.

Tracy Mason
Tracy Mason
Courses Plus Student 2,446 Points

I'm with you. Having a much harder time of following this one compared to the other videos.

Suneal P
Suneal P
4,907 Points

Totally agree. Glad I'm not alone in this...

I've been watching them a couple times, pausing and trying to understand the logic. I wish he explained why he's doing things more frequently.

3 Answers

Javascript can be confusing to learn and something I think it takes time, a lot practice, and patient to get a solid feel for it. Before following this course, I took the "Build an Interactive Website with Javascript" which I think covers a few things that was use in this course, especially how html is connected and interacting with javascript.

The hardest part for me in this course was trying to understand how "prototypes" works, its relation to constructor function and the nature of prototype inheritance. Took me some research and outside reading to get a better feel and than re-explan the concept to myself using a real-life process or model that I am familiar with.

Another thing I had difficulty with was fitting the logic behind it and how it all flows together. One thing I did to get better feel was doing to write everything from scratch by following along the video. It really helped me by pausing typing the commands and write a comment about the purpose of prototype, functions, and line code that seem difficult. Referencing the interconnections with flow chart notes. It might seem like meticulously overkill but I find to be very helpful and reinforce my learning.

/*
Play, stop, and next button is referenced to HTML button to the id play tag. When click, launch 
the click event function. 

Calls the playlist variable and instantiate the Playlist constructor 
and the renderInElementList along with the properties. 

Execute the native javascript functions to the playlist.  

The renderInElementList pushes the song list into toHTML prototype and writes it back to UI html designated html list tags, basically refresh and updates the list.

Flow: Start HTML(button) => app.js (Event onclick Handler) => song,js: (prototype) and app.js playlist variable
       => Playlist.js: Playlist object & Props => call up its prototype => renderELMT func 
       => calls playlistelement => (song.js) toHTML prototype => adds in to UI index =>  End.   
*/ 

var playButton = document.getElementById("play");
var playButton.onclick = function() {
  playlist.play();
  playlist.renderInElement(playlistElement);
}

Anyway, please do not be discourage and I hope this may help some of you and best of luck on your javascript learning :). Off to the next lesson.

I'm planning to do the same thing, once I get it working. This is a very new course, so I'm sure the Team Treehouse folks and Andrew will welcome our feedback.

Christopher Denny
Christopher Denny
10,460 Points

Thank you very much for your suggestion. As I've slept on it and worked a bit more with it, I'm getting a tad more comfortable with the concepts, but I still think I want to take that "Build an Interactive Website with Javascript" course before re-continuing this one. Thank you again for your suggestion and your inspiration =)

Tiffany McAllister
Tiffany McAllister
25,806 Points

I'm glad I'm not the only one having trouble keeping up with this course. It seems like it's too much all at once and there's not enough explanation for each step. I could follow it ok up until "Methods with Prototypes" and pretty much everything after that seems to have sped up too fast.

Darien Kim
Darien Kim
3,126 Points

Same here, I can follow this course and exercise but.. I don't want to just follow this recipe. I just don't understand too many thing when he write things. I was doing alright up until JS object oriented , this is so much different from other previous tree-house courses and exercises, too many things going on at once with lack of explanations. I wish theres new courses for prototype and construction function with better exercises.