Possible Duplicate:
What advantages does using (function(window, document, undefined) { … })(window, document) confer?
Advanced Javascript: Why is this function wrapped in parentheses?
I just checked how jquery is written, then in the first line of it i see this:
(function( window, undefined ) {
});
My question is what is the meaning or reason the declaration of function is inside the ( and )?
In your example, I see no reason for the parentheses.
For immediately invoked functions, Douglas Crockford recommends and provides a code sample as below. Source is http://javascript.crockford.com/code.html