Any nesting level in JavaScript
There may be also such function calls:
func()()() and func()()() -
and so on ad infinitum.
To do this, you need the inner function to also return a function, that one - another one, and so on. Here is an example:
function func() {
return function() {
return function() {
return '!';
};
};
}
console.log( func()()() ); // shows '!'
Make the function func that,
when called like this: func()()()()(),
will return '!'.