var Human = function (type) {
this.type = type || 'human';
}
Human.isHuman = function (human) {
return human instanceof Human;
}
Human.prototype.breathe = function () {
return 'h-a-a-a-m';
}
var Hj = function (type, firstName, lastName) {
Human.apply(this, arguments);
this.firstName = firstName;
this.lastName = lastName;
}
Hj.prototype = Object.create(Human.prototype);
Hj.prototype.constructor = Hj;
Hj.prototype.sayName = function () {
return this.firstName + ' ' + this.lastName;
}
var oldHj = new Hj('human', 'hyungju', 'lee');
console.log(Human.isHuman(oldHj));
console.log(oldHj.breathe());
console.log(oldHj.sayName());
console.log(oldHj.isHuman);