Check out a free preview of the full Deep JavaScript Foundations course:
The "Linked Prototype Diagram" Lesson is part of the full, Deep JavaScript Foundations course featured in this preview video. Here's what you'd learn in this lesson:

Kyle revisits the prototype diagram he drew on the whiteboard earlier. This time, however, he shows a more sophisticated version outlining the relationship of the two linked prototypes.

Get Unlimited Access Now

Transcript from the "Linked Prototype Diagram" Lesson

[00:00:00]
>> Kyle Simpson: This is the mental model that you need to juggle to understand what's going on with these prototype oriented pieces of code. You'll notice that that's the diagram that I was basically drawing, although I didn't fully finish it out, but that's basically the drawing. That's basically the diagram that we were getting at, if we put in the Bar, it would added Bar proto type to speak and all of that.

[00:00:19] So, there's your diagram, but the problem is this diagram is not fully complete. We glossed over some somewhat important details. Here's the complete diagram, and I really didn't wanna draw that on the board. That's the complete diagram with all of the pieces just from that one program that we were talking about.

[00:00:41] To fully explain all of the relationships you have to diagram all that stuff out. Now I don't know about you, but I don't think that's a very effective mental model for me to figure out what I'm doing with my code. There's a lot of complexity there hiding the simplicity of the power of that system.