function Fuck() {
this.species = 'Not specified';
};
Fuck.prototype.fuck = function () {
console.log('Fuck' + this.species);
};
function FuckHuman() {
this.species = 'Human';
Fuck.call(this);
}
FuckHuman.prototype = Object.create(Fuck.prototype);
// Set the "constructor" property to refer to FuckHuman
FuckHuman.prototype.constructor = FuckHuman;
function FuckYou() {
this.name = 'You';
FuckHuman.call(this);
}
FuckYou.prototype = Object.create(FuckHuman.prototype);
FuckYou.prototype.constructor = FuckYou;
FuckYou.prototype.fuck = function () {
console.log('Fuck ' + this.name);
}
var fuckYou = new FuckYou ();
fuckYou.fuck();
网友评论