목록전역 this (1)
Frontend 개발자 - hyo.loui

❤️🔥TIL : Today I Learned 명시적 this 바인딩 상황에 따라 달라지는 this 메서드 내부 함수에서 this 우회 명시적 this 바인딩 상황에 따라 달라지는 this this는 실행 컨텍스트가 생성될 때 결정(this binding) === this는 함수를 호출할 때 결정하며 전역 공간에서 this === window // 전역 공간에서의 this console.log(this); console.log(window); console.log(this === window); //true 함수 호출시 this === window ex) function(); // 함수와 메서드 호출시 각각 this 는 각각 다르게 할당 var func = function (x) { console.log..
Javascript
2022. 12. 2. 21:00