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?
11 Replies
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.
oh ok, that's good to know then 😂 because I found it really confusing ðŸ˜
Same 😄
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
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
i was talking about this
this is different from the JavaScript prototype?
oh, yeah, I think we're talking about the same thing
hehe xD
sorry x_x
no prob xD