There is a constructor:
var Human = function(name){ this.name = name; }; I will write down the new method in the prototype of the constructor:
Human.prototype.say = function(what){ console.log(this.name + " : " + what) }; Now every object created using the new keyword will inherit a Human.prototype, like this:
var alex = new Human("Alex"); Is this the only way to add new methods to the constructor?