Adding a Method to a Constructor

Your constructor function can also define methods :

NOTE: You cannot add a new method to an object constructor the same way you add a new method to an existing object. Adding methods to an object constructor must be done inside the constructor function: