자바 스크립트에서 '전화'에 대한 질문이 있습니다.'전화 걸기'는 자바 스크립트에서 어떻게 작동합니까?
var humanWithHand = function(){
this.raiseHand = function(){
alert("raise hand");
}
}
var humanWithFoot = function(){
this.raiseFoot = function(){
alert("raise foot");
}
}
var human = function(){
humanWithHand.call(this);
humanWithFoot.call(this);
}
var test = new human();
so .. 내가 '전화'를 humanWithHand.call (this)로 사용하면 내부적으로 어떤 일이 발생합니까?
humanWithHand는 변수와 구성원을 인간 변수의 프로토 타입에 복사 (또는 가리킨다)합니까?
[MDN 문서 호출()] (https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Function/call) – epascarello