Skip to content
loading...

πŸŽ‰πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§ JavaScript Visualized: Prototypal Inheritance

Lydia Hallie on January 03, 2020

Ever wondered why we can use built-in methods such as .length, .split(), .join() on our strings, arrays, or objects? We never explicitly specified ... [Read Full]
markdown guide
 

You should really make a tutorial for creating these beautiful Gifs as well :)

 

Lmao β€œhi guys welcome to my tutorial today we start off by having caffeine-induced insomnia and getting random ideas for animated gifs using Keynote at 4AM...”. But I may actually totally do it if it can help people :)

 
 

yes. please do it. The GIFs are awesome. "Tell us how" in a video.

 

I just auth'd to the community so I can β™₯️ the parent comment and compliment how awesome the GIF is. easy to read, clean transition and carries the point across.

 
 
 
 
 
 

Yes please, lydia I was just gonna ask it will mean alot to me, thank you mukesh for asking this question ur great mate!πŸ˜‰

 

Prototype, no one really uses it directly but it is one of the main architectural points of the language...

Instead we now have class, because, then we can look more like C# and Java, yay for pointless uniformity!

I wonder how pop JS would have looked today if we didn’t have all the baggage from poorly researched classical languages. :)

 

I already mentioned in another discussion that still I wonder why prototypical inheritance is rarely taught at CS or SE classes. It's a very strong paradigm and mostly misused due to misunderstanding.

 

It reminds me of how interpreters evaluate variables through different closures/scopes. If it's not in this scope, let's check the next one, and so on. Once we've checked everything up to global scope and still haven't found the variable, it is considered undefined. Very useful information.

 

Having used JS’s version 10-12’ish years ago days I can definitely understand why.

I had a lot of problems making it have good verbosity, I might give it a go again sometime, back then I was kind of a rookie. :)

That being said, I think it comes down to familiarity, most languages are made to resemble classical OOP and their structures, the commonly accepted truth has been that is was the most optimal way.

But if we look back, most of those features were based on popularity and not research on what would be better to manage state, have high verbosity etc.

Just look at Java literally founded on hype, but I digress, I am seeing a strong pull towards more diverse paradigms, it will be interesting to see were that takes us. :)

 
[deleted]
 

Not really, but I can see how you could interpret it like that.

I’m not sure how to help you understand how proper debate is done in this context.

But an accusation without argumentation is a really bad way to start a conversation. :/

Honestly it pissed me off a bit.
But maybe we can turn this around?

[deleted]

Okay let’s stop this discussion here or continue on hackernews lol

Actually yes, you could have asked for sources, and I could have given them.

Instead you decided to attack my intentions, which you have no way of knowing.

Please think about this before you comment more. I’ve given up my initial annoyance/insulted feelings, that was not easy, you clearly have not.

I’m not trying to keep some kind of moral high ground here, but I don’t know were to meet you if you keep this level of unwillingness to have a constructive debate.

 
 
 

You have a true gift for blogging. Keep on writing!

 

This is awesome. It made me realize again that there are a lot of things I 'just use' without understanding it. Which is bad. :D

 

Came here with a "yeah, I understand JS prototypes but a visualization could be cool" and then realized how much this exceeded expectations. Great job with not just the explanations but also the animated graphics. Nicely done indeed.

 

It was Yesterday, when i was working on project. Inspecting Front-end code with google chrome dev tools and this thought struck my mind who would've written all these codes,where they came from.

thepracticaldev.s3.amazonaws.com/i...

And this day i found this article explaining everything very beautifully.
Thank you!

 

Excellent articles, excellent visuals. Here's a resource I used to drill this down, with excellent explanations and visuals as well: objectplayground.com/

 

Your visual JS posts are the best for newbies as they provide the pertinent info needed!

bigleegeek

 

Good read. All this time I thought of JS prototype as a cool way to add functionality to objects that have already been instantiated. It all makes sense now :)

Seeing how an object is composed from a class was cool too.

 

Thank you so much for this awesome tutorial! Well explained. I finally understand what all those _proto_ mean in my console πŸ˜‚

Love your gif, they're very practical for understanding.

 
 

Lydia, I really admire how articulate and visual your posts are, great article as usual. Keep up the awesome work :)

 
 

Superb! I'm learning React at the moment and this helped me understand some of the structure of Class based components!

 

That's great! Yeah it's definitely an important thing if you want to understand what's really going on when you're using React.

 

Awesome content! I've been constructing objects in Javascript for a while, and never thought about adding methods directly to the prototype to save memory.

Thanks for that! πŸŽ‰

 

Yhea, I am fond of your articles. Could you write one about book recommendation?

 

Hey @lydia! Just discovered this and your twitter!

Amazing work pushing such excellent content soon after coming out of a bootcamp! Looking forward to all your future content!

subscribed

 

Excellent! Must have been hard to prepare

 

The animated diagrams help a lot! Thanks. ☺

 
 
 
 

it was an issue I was working on these days. Thank you, Lydia. With this animations, i completely figure out 🀩

 

This rules. The gifs make it exciting and clear to what is happening, your explanations are simple and fun! Thank you!

 
 
 

thank you for your sharing. now I know why we don't need to code: arr.prototype.filter(...), but arr.filter(..).

 

This is such a cool article! Thank you for sharing ❀️

 

Very, very, very... koolllllllllll yes!!! Thank you (great art πŸ–Ό and animations) πŸ’ͺ🏽 πŸ™πŸΏ πŸ‡ΊπŸ‡Έ

 

Great article and beautiful graphics to explain concepts! Keep writing more, we will be reading...

 

I love how you can make your articles so informative and in the same time, so super-fun to read. All the best to you!

 

It's just a JavaScript there is no magic there, even Prototyping is a JavaScript that helps in extend, add extra custom functionality to an existing object. Am I wrong?

 

Can you please tell me about Function overloading and overriding in Javascript?

 
 
 

This was awesome. Recently completed the OOP section on freeCodeCamp and your article helped me cement those concepts

 

Very good explanation with images, loves it.

 

Which tool do you use to craft these beautiful code flow and animations? Would love to hear about that.

 
 

Thank you so much for this lessons.
The GIF's are amazing and it is easy to understand.

 

Hi! Awesome article. I had a little question, how do you do that amazing animations?

 
 
 

@theavocoder, In the last example, why me there is a proto if only Functions there is a prototype?

 

πŸ™ Thank you for sharing this, very well explained.

code of conduct - report abuse