this maybe a little late however myMy understanding of the asker's question is such that:
howHow does this magic work:
(function(){}) ('input') // utilisedUsed in his example I maybemay be wrong however. However, the usual practice that people are familiar with is:
(function(){}('input') ) theThe reason is such that javascriptJavaScript parentheses akaAKA ()(), can't contain statements and when the parser encounters encounters the function keyword, it knows to parse it as a function expression and not a function declaration.
sourceSource: blog post http://benalman.com/news/2010/11/immediately-invoked-function-expression/Immediately-Invoked Function Expression (IIFE)