main.js
1
2
3
4
5
6
7
8
9
10
function closureSample(value) {
    var a = value;
    function f() {
        return a
    }
    return f;
}
var s = closureSample("abcde");
s(); // "abcde"
Native Browser JavaScript