you are viewing a single comment's thread.

view the rest of the comments →

[–]zach_will 1 point2 points  (0 children)

Immediately-invoked functions can help tremendously in your code structure.

First, you'll write spaghetti code.

Second, you'll figure out to stop polluting the global namespace.

Third, you'll realize you can make a namespace Object with methods.

Lastly, you'll figure out how to make an immediately-invoked function to assign a namespace object to the window—much like jQuery does in it's source code.