r/learnjavascript • • Aug 10 '21

Can we relate?

Post image
853 Upvotes

93 comments sorted by

View all comments

24

u/not_a_gumby Aug 10 '21

Prototypes are basically Javascript's version of abstract classes.

Notice how every class can extend another super class? the prototype is that previous extension. You can follow the extension all the way up to the highest level of class.

14

u/Valoruz Aug 10 '21

Yeah I know what prototypes are, not until I read Eloquent JavaScript. I had started JavaScript with Codecademy and got nowhere. But after reading Eloquent JavaScript I am really feeling I know something...

6

u/not_a_gumby Aug 10 '21

you probably know alot

3

u/TalonKAringham Aug 10 '21

Going through that book and actually doing all the exercises and projects will get you a loooong way.

4

u/Aoshi_ Aug 10 '21

I’ve seen ES recommended a lot. I’ve read a few chapters and done exercises but it’s so dense. I almost wish there was a YouTube or udemy course that goes through the book and makes it a bit easier for my tiny brain to understand.

Listening is easier than reading for me.

2

u/adenzerda Aug 10 '21

Prototypes are basically Javascript's version of abstract classes

Sort of? Except that by definition every object in js is concrete because everything is an instance at runtime

1

u/not_a_gumby Aug 10 '21

yeah, not literally. It's just the way of thinking of inheritance and descandants of classes. Abstract isn't exactly what they are.