function Person(name){ this.name = name; this.type = 'human'; this.info = function() { console.log("Name:", this.name, "Type:", this.type); } } Person.prototype.roboinfo = function(){ console.log("Name:", this.name, "Type:", this.type, "Processor:", this.cpu); } function Robot(name){ Person.call(this, name) // akin of calling super, this is what allows us to inherit props this.type = 'robot'; this.cpu = 'AMD64' } // Set Robot's prototype to Person's prototype Robot.prototype = Person.prototype; // Set constructor back to Robot Robot.prototype.constructor = Robot; person = new Person("Bob"); robot = new Robot("Bender"); person.info(); // Name: Bob Type: human robot.info(); // Name: Bender Type: robot robot.roboinfo(); // Name: Bender Type: robot Processor: AMD64