변수에 this 저장 (1) 썸네일형 리스트형 [JavaScript] 메서드 내부함수에서의 this 우회법 (call, apply, 그리고 bind 의 차이 이 글은 this 에서 넘어온 글입니다.https://daunje0.tistory.com/manage/newpost/84?type=post&returnURL=ENTRY Tistory좀 아는 블로거들의 유용한 이야기www.tistory.com var a = 10; var obj = { a: 20, b: function () { console.log(this.a); // 20 (메서드로써 호출했으므로 obj 객체가 this이다) function c() { console.log(this.a); // 10 (함수로써 호출했으므로 전역 인스턴스 this) } c(); } } obj.b(); call, apply, 그리고 bind는 .. 이전 1 다음