JavaScript의 this와 MPA 구현
TIL
오늘은 자바스크립트의 this 개념을 복습하고, 자바스크립트로 간단한 멀티 페이지 애플리케이션(MPA)을 구현했다.자바스크립트의 this 이해하기자바스크립트에서 this는 호출 방식에 따라 참조하는 대상이 달라진다.// 일반 함수에서의 thisfunction normalFunction() { console.log(this); // window 객체(브라우저 환경)}// 메서드에서의 thisconst obj = { name: '객체', method: function() { console.log(this); // obj 객체 자신을 가리킴 }};// 이벤트 핸들러에서의 thisbutton.addEventListener('click', function() { console.log(this); /..