constructor
의 무한 체인 인 이유
function Test()
{
this.name = 'test name';
}
console.log(Test.prototype.constructor.prototype.constructor);
내가 이해할 수없는 - prototype
?자바 스크립트 프로토 타입 생성자 혼란
이 체인의 목적은 무엇이며 왜 끝이 없는지, 프로토 타입에는 생성자가 있으며 생성자에는 프로토 타입, 루프 체인 및 생성자가 매번 같아 상상할 수 없다는 것을 의미합니다. ...
hmmm 또한 prototype.constructor.constructor.constructor. - 믿을 수 없지만, 여전히 이해하려고 노력하고 있습니다. 감사합니다. – Hello
@Hello'.prototype.constructor.constructor'를주의 깊게 보면,이 함수는'Function()'기본 생성자를 참조합니다. 함수는이 언어의 * object *라는 것을 기억하십시오. – jAndy