Subscribe to my Feed

JavaScript - Anonymous and Self-executing functions

    

Anonymous functions Wrapping the function in parentheses makes it anonymous.  An example would be; var Init = (function() { // some code return function () { // some dynamic code dependent upon your previous code }; }); In order for Init to execute as a function when it is actually executed, your code within the declaration of Init must return a function. The code above is simply the constructor for a function, there the returned function code is ...

 2192 Views   0 Comments Read more »

Back to top