Prototype
Prototype : 객체의 원형
1. Prototype Chain
function Ultra(){}
Ultra.prototype.ultraProp = true;
function Super(){}
Super.prototype = new Ultra();
//*주의! Super.prototype = Ultra.prototype 으로하면 안됨
//부모관계인 Ultra.prototype의 값 또한 변경되기 때문
function Sub(){}
Sub.prototype = new Super(); //Super.prototype을 원형으로 하는 객체 생성
var o = new Sub(); //Sub.prototype을 원형으로 하는 객체 생성
console.log(o.ultraProp);
//trueLast updated