var, let, const 선언이 호이스팅 되는 방식과 이들이 스코프 규칙에 어떤 영향을 미치는지 설명해 주실 수 있나요? #23
Unanswered
lledellebell
asked this question in
실행 컨텍스트(Execution Context)
Replies: 1 comment
-
|
먼저 호이스팅이란 변수선언이 해당 스코프의 최상단으로 끌어올려진것 처럼 동작하는 JavaScript의 행동 1.var로 선언된 변수는 초기화와 함께 호이스팅됩니다. 이는 변수가 선언된 위치와 관계없이 함수의 시작부분에 메모리에 할당된 다는 것을 의미합니다. 스코프 규칙 var은 함수 스코프를 가집니다. 즉, var 변수는 선언된 함수 내에서 어디서든지 접근할 수 있으며,함수 밖에서는 접근 할 수 없음. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
Beta Was this translation helpful? Give feedback.
All reactions