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•3w 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
Faker•3w ago
oh ok, that's good to know then 😂 because I found it really confusing 😭
Jochem
Jochem•3w ago
Same 😄
glutonium
glutonium•3w 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•3w 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•3w ago
i was talking about this
No description
glutonium
glutonium•3w ago
this is different from the JavaScript prototype?
Jochem
Jochem•3w ago
oh, yeah, I think we're talking about the same thing
glutonium
glutonium•3w ago
hehe xD
Jochem
Jochem•3w ago
sorry x_x
glutonium
glutonium•3w ago
no prob xD
Want results from more Discord servers?
Add your server