[javascript] this bind, this 바인딩(어렵다 어려워)

* boycoding.tistory.com/22?category=915176 jeonghwan-kim.github.io/2017/10/22/js-context-binding.html 글을 읽고 공부하며 요약정리한 글입니다 this는 함수가 호출되는 패턴에 따라서 다른 객체를 참조(바인딩) 한다 객체 메서드 호출: 메서드를 호출하는 객체에 바인딩 함수를 호출: 전역 객체에 바인딩 (내부 함수 호출 포함) 생성자 함수 호출: 새로 생성되는 객체에 바인딩 1. 객체 메서드 호출 const a={ name:'sara', output:function(){ console.log(this.name); } } const b={name:'b'} b.output=a.output a.output(); //sara 암시적 바..