[Study] 스코프 | Lexical scope, Scope chain, Global scope, Function scope
JS는 lexical scope를 따릅니다. JS의 변수 스코프를 이해하기 위해 관련된 개념을 알아봅니다. Global scope 글로벌 스코프는 Global 객체인 Window 객체의 Scope를 말합니다. JS는 별 다른 Main 함수가 없기 때문에, JS를 처음 접하시는 분들은 Global scope에 변수를 선언하기 쉽습니다. Global scope에 변수를 선언하게 되면, 다른 변수와 변수명이 겹쳐 충돌할 가능성이 있습니다. let testWord = "Global scope hello world!" // Global scope const functionScope = () => { let testWord = "Local scope hello world!" // Function scope cons..
Study
2021. 4. 22. 03:05
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- start with digit
- webpack
- flutter doctor
- querySelector
- Lexical scope
- leftJoin
- craco-alias
- ts(2564)
- getElementById
- CRA
- tsconfig
- Function scope
- undefined
- getElementsByClassName
- NodeSelector
- android-licenses
- url mapping order
- hmr
- SMUI
- jsconfig
- getElementsByTagName
- DOM API
- Global scope
- code technic
- state_undefined
- event delegation
- Nullish coalescing operator
- querySelectorAll
- save-exact
- js
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
글 보관함