So how did you do.
Here's a solution for the previous problem.
I'm placing all of the properties that I do not want shared for each object inside of the constructor
function and moving all of my functions that I want each object to have inside the vehicle prototype
.
If you didn't get this one watch the previous couple of videos and try it again.
This stuff takes practice.
To summarize.
We saw that every time the new keyword is used a dunder Prato property is added to the object created
from the constructor function.
The Dondre produce property links the object created from the constructor function to the prototype
property on the constructor function.
This link allows objects created from the constructor function to access methods and properties on the
prototype object.
The prototype property also contains a property called constructor which points back to the constructor
function.
Finally we should always strive to place properties and methods that we want to share among all of our
objects created from a constructor in the prototype.
As these properties and methods only need to be defined once and not redefined for every single object
.
Thanks again for watching the series on object oriented programming.
As always if you have any questions be sure to let us know.
We're always here to help.
Thanks again and I'll see you soon.