
[ JS ] Call & Bind & Apply 완벽 정리
·
Language/JavaScript
Call & Bind & Apply함수 안에서 this를 사용하면 Window 객체를 참조하게 된다. 하지만 다른 객체를 참조하길 원할 때 우리는 어떻게 해야할까? 💡 Tip이 내용을 이해하기 전에, 먼저 this 키워드에 대해 알고 있어야 합니다. 만약 잘모르신다면 아래의 링크를 통해 공부하고 오시는 것을 추천드립니다. [ JS ] 자바스크립트 this 키워드 정복하기this 작동 범위let audio = { title: 'a', title2 : this.title, play() { console.log('play this: ', this.title); }};console.log(audio.title2); //undefinedaudio.play(); // play this: a 위 코드에서 함수 블록..