http://www.youtube.com/watch?v=yiEeiMN2Khs
Published on Oct 12, 2013
A JavaScript closure is a function that has a pointer reference to a free variable.
A free variable is one that has fallen out of scope after its parent function has returned.
However, if that outer function still has some reference to the free var (normally through
a function that gets returned, or through a method property),
the variable will not get garbage collected because it will have a non-zero reference count.
Thus, from outside the function, we can still access the inner variable by means of the closure.
'자바·파이썬·자바스크립트 > 자바스크립트' 카테고리의 다른 글
Ajax는 무엇인가요? (0) | 2012.01.18 |
---|---|
예제 중심의 자바스크립트 책 (0) | 2012.01.18 |
<기초>자바스크립트 눌린 키 상태 확인하기 (0) | 2011.12.27 |
JavaScript RegExp evaluator (0) | 2011.12.22 |
자바스크립트 정규식: 특정 단어 제외하는 방법 (0) | 2011.12.22 |