module.exports = MyChild;
var MyParent = require('./MyParent');
function MyChild() {
this.myName = 'jaehunpark';
this.mySex = '남';
this.myAge = 26;
this.myLaptop = 'mac book';
this.myPhone = 'galaxy';
}
MyChild.prototype = new MyParent();
MyChild.prototype.constructor = MyChild;
MyChild.prototype.myInfo = function () {
function getMyJuminNo(){
return 'my juminNo : 921234-5678910';
}
console.log('my name : ' + this.myName );
console.log('my sex : ' + this.mySex );
console.log('my age : ' + this.myAge );
console.log(getMyJuminNo());
};
MyChild.prototype.myFamillyInfo = function () {
MyParent.prototype.myInfo.call(this);
this.myInfo();
};
MyChild.prototype.myBelongings = function () {
switch (arguments.length) {
case 0 :
console.log('my laptop : ' + this.myLaptop);
console.log('my phone : ' + this.myPhone);
break;
case 2 :
this.myLaptop = arguments[0];
this.myPhone = arguments[1];
console.log('my laptop : ' + this.myLaptop);
console.log('my phone : ' + this.myPhone);
break;
}
};