function test() { return function x() { return "xxxxxxxx" } } console.log(test()) //[Function: x()] console.log(test()()) //xxxxxxxx