
function Person(name, first, second){
this.name;
this.first;
this.second;
}
-Person이라는 함수와 Person 함수의 프로퍼티 중 하나인 prototype 객체가 생성된다.
-Person의 prototype은 소속을 알려주기 위해 constructor 프로퍼티에 기록해둔다.
Person.prtototype.sum = function(){};
const kim = new Person('kim', 10, 20);
const lee = new Person('lee', 10, 10);
-Person 함수 내부에 this로 정의된 값들이 프로퍼티로 생성된다.
-동시에, proto 프로퍼티도 생성되는데, 이는 Person의 prototype을 가르키도록 만들어졌다.
console.log(kim.name);
kim이라는 객체로 가서 name이라는 프로퍼티를 찾는다.
kim.sum();
마찬가지로 kim이라는 객체로 가서 함수 sum을 찾는다. 만약 존재하지 않는다면,
⭐__prototype__을 따라가 함수 Person의 prototype 객체로 가서 sum( )을 찾는다.