call1 call, apply,bind call, apply, bind : 함수 호출 방식과 관계없이 this를 지정할 수 있다. call 콜 메서드는 모든 함수에서 사용할 수 있으며, this를 특정값으로 지정할 수 있다. 매개변수가 있으면 호출하며 실행한다 const mike={ name : "Mike", }; const tom ={ name: "Tom", }; function showThisName(){ console.log(this.name); }; showThisName(); //"" showThisName.call(mike); //"miki" /////////update를 만들어 내용을 더 추가하자 const mike={ name : "Mike", }; const tom ={ name: "Tom", }; function showTh.. 2022. 2. 26. 이전 1 다음