1번 문제를 풀다가 궁금한 점이 생겨서 질문 드립니다.
function Parent() {
this.name = "Kim";
}
var a = new Parent();
a.__proto__.name = "Park";
console.log(a.name); // Kim
console.log(Parent.prototype); // { name: 'Park' }
var b = new Parent();
console.log(b.__proto__); // { name: 'Park' }
console.log(b.name); // Kim
Student로 생성된 a 오브젝트로 Student의 name을 'Park'으로 변경해서
이후로 Student로 생성된 b 오브젝트에는 name에 'Park'가 있을 것으로 예상했는데
예상과 달리 Kim이 뜹니다. 왜 일까요?