- 11. Anonymous Functions, Scope and Closures: Serious functions
- Publisher: O'Reilly Media, Inc.
- Released: March 2014
Why am I assigning a function invocation to a reference variable here?
A tip: because the invoked function is supposed to return a function. But why you did not call that function directly. Because the inner function is nested and it is not global so in order to execute the outer function (the enclosing function) which is supposed to return a reference to the inner function, I need to assign the returned function to some global variable to be able to execute it.