Prototype in JavaScript

Hello guys, can someone explain roughly about what prototype is in JavaScript please; I just had a look at it, from what I've understood, prototype deals with about what properties/methods are inherited from the class/constructor our object is being instantiated of. But I'm having a bit of difficulties to understood the diagram... can someone explain it please... also, was that correct to say that we can create an instance of an object using a constructor?
No description
11 Replies
Jochem
Jochem•2mo ago
I don't have a good answer for you, but I've also used JavaScript on and off since 1997, so I suppose that's a bit of an answer in and of itself. Unless you're doing very fancy shit, you never, ever use prototypes.
Faker
FakerOP•2mo ago
oh ok, that's good to know then 😂 because I found it really confusing 😭
Jochem
Jochem•2mo ago
Same 😄
glutonium
glutonium•2mo ago
If i am not wrong prototyping is design pattern and is like a whole damn paradigm of it's own and yah, 99% of the time u won't really need that
Jochem
Jochem•2mo ago
nah, this is a language feature of Javascript. Building a prototype, as in a quick-and-dirty minimum viable product, is totally useful in a lot of circumstances
glutonium
glutonium•2mo ago
i was talking about this
No description
glutonium
glutonium•2mo ago
this is different from the JavaScript prototype?
Jochem
Jochem•2mo ago
oh, yeah, I think we're talking about the same thing
glutonium
glutonium•2mo ago
hehe xD
Jochem
Jochem•2mo ago
sorry x_x
glutonium
glutonium•2mo ago
no prob xD
Want results from more Discord servers?
Add your server