summaryrefslogtreecommitdiffstats
path: root/samples/func_ret_func.js
blob: 2decac350f7dbb212410bbbee267427bcae47c80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* very fucking weird!
 */

function retFunction(foo) {
    return function bar() {
        console.log(foo);
    }
}

var foo = new retFunction('hello, world!');
foo.call(foo); /* call the bar() with no args in foo object */