Hoisting
JavaScript Hoisting refers to the process whereby the interpreter appears to move the declaration of functions, variables or classes to the top of their scope, prior to execution of the code.
Hoisting allows functions to be safely used in code before they are declared.
Variable and class declarations are also hoisted, so they too can be referenced before they are declared. Note that doing so can lead to unexpected errors, and is not generally recommended.
호이스팅 - 용어 사전 | MDN
JavaScript에서 호이스팅(hoisting)이란, 인터프리터가 변수와 함수의 메모리 공간을 선언 전에 미리 할당하는 것을 의미합니다. var로 선언한 변수의 경우 호이스팅 시 undefined로 변수를 초기화합니다
developer.mozilla.org
'STUDY > Java Script' 카테고리의 다른 글
Element.append() VS Node.appendChild() (0) | 2022.07.22 |
---|---|
자바스크립트의 배열에 대한 시간 복잡도 O(n) (0) | 2022.07.21 |
Pointer events, Mouse events (0) | 2022.07.16 |
[JS] div, form, input /// EventListenr 의 event 의 preventDefault() (0) | 2022.07.13 |
유튜브 더 보기 팝업 차단 (0) | 2022.07.13 |