this this는 실행 컨텍스트가 생성될때 함께 결정된다. 즉 this는 함수를 호출할 때 결정된다. 상황마다 this값이 달라진다. 전역공간에서 this는 전역 객체이고 브라우저환경에서 전역객체는 window, node.js 환경에서는 global 이다. 브라우저환경 console.log(this); console.log(window); console.log(this===window); //true Node.js환경 console.log(this); console.log(global); console.log(this===global); //true 전역변수를 선언하면 자바스크립트 엔진은 이를 전역객체의 프로퍼티로도 할당한다. var a = 1; console.log(a); // 1 console.lo..