[JavaScript] - 변수의 유효범위와 클로저 #69
Unanswered
Irisation23
asked this question in
JavaScript
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
변수의 유효범위와 클로저
들어가기에 앞서 이런 의문점을 가져보자.
단계 1. 변수
자바스크립트에선
실행 중인 함수
, 코드 블록{...}
, 스크립트 전체는렉시컬 환경(Lexical Environment)
이라 불리는내부 숨김 연관 객체(internal hidden associated object)
를 갖는다.렉시컬 환경 객체는 두 부분으로 구성된다.
this
값도 해당된다.자 지금 부터 중요한 부분이다.
변수
는 특수 내부 객체인 환경 레코드의 프로퍼티일 뿐이다.변수를 가져오거나 변경
하는 것은환경 레코드의 프로퍼티를 가져오거나 변경
하는 것을 의미한다.Beta Was this translation helpful? Give feedback.
All reactions