JavaScript, Constructor Function, Prototype Chain, Front End Development.
method is defined many times for each object. If we assign it as a prototype, the methods are not copied and remain as references in the constructor. It is very important for performance. Now let’s stop our vehicle and finish the topic. car.prototype.stop = function(){ console.log("vehicle