1.1.1. 전역 변수
let scopr = "global scope" // 전역변수 할당
1.1.2. 지역 변수
function checkScope() { let scope = "local scope" // checkScope 함수 내에 지역변수 할당 }
1.1.3. 스코프
let scope = "global"; function checkScope(){ let scope = "local"; return scope; } checkScope()
1.2.1. 정의
클로저는 함수와 함수가 선언된 어휘적 환경의 조합이다.
https://developer.mozilla.org/ko/docs/Web/JavaScript/Closures
let scope = "global"; function checkScope(){ let scope = "local scope"; function f() { return scope;} return f(); } checkScope()