This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getResult = (function() { | |
var res = 2 + 2; | |
return function() { | |
return res; | |
}; | |
}()); | |
gerResult; //function () { return res; } | |
getResult(); //4 |
이미 반환된 함수가 자신을 리턴했던 함수 내부의 변수를 계속 참조 할 수 있네..