Can someone explain me what prototypes represent, and why they say you can't change constructors?

Can someone explain me what prototypes represent, and why they say you can't change constructors?
0

Can someone explain me what prototypes represent, and when to use them. Also, why they say you can’t change constructors?What can i do to add a new property to a object based on constructor?

1 Like

The prototype is kind of like a blueprint. Every data object (things that aren’t primitives) in JS have a prototype. You can even make your own and adjust them. The constructor tells the prototype how to build a new instance of that object. I can’t at the moment remember why the constructor can’t be changed.

I’d recommend looking for some youtube videos. I found that a great resource for lots of people visually explaining complex concepts.

2 Likes