Extend by CrockFord

by Artem

JavaScript

var Parent = function() {

};
Parent.prototype.canTalk = function() {
  return 'My name is ' + this.name;
};

var Child = function(name) {
  this.name = name;
};

var F = function() {};
F.prototype = Parent.prototype;
Child.prototype = new F();
Child.prototype.constuctor = Child;

var child = new Child('batman');
console.log(child instanceof Child);