closure - hochan222/Everything-in-JavaScript GitHub Wiki

โ€œWriting in ECMAScript language without understanding closure is like writing Java without understanding classesโ€ โ€” Douglas Crockford, father of JSON

hello = null;
  • ํด๋กœ์ €๋ฅผ ํ†ตํ•ด ๋‚ด๋ถ€ ๋ณ€์ˆ˜๋ฅผ ์ฐธ์กฐํ•˜๋Š” ๋™์•ˆ์—๋Š” ๋‚ด๋ถ€ ๋ณ€์ˆ˜๊ฐ€ ์ฐจ์ง€ํ•˜๋Š” ๋ฉ”๋ชจ๋ฆฌ๋ฅผ GC๊ฐ€ ํšŒ์ˆ˜ํ•˜์ง€ ์•Š๋Š”๋‹ค. ๋”ฐ๋ผ์„œ ํด๋กœ์ € ์‚ฌ์šฉ์ด ๋๋‚˜๋ฉด ์ฐธ์กฐ๋ฅผ ์ œ๊ฑฐํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.

https://poiemaweb.com/js-closure https://medium.com/madhash/understanding-closures-in-javascript-in-3-minutes-557ebb8a215b