Skip navigation

Learning experience with JavaScript is more excited day-by-day.

//
(function(undefined) {
    alert(typeof undefined);   // boolean
})(true);
//
(function(undefined) {
    alert(typeof undefined);   // undefined
})();
//

Refer jQuery source code (development version 1.7.1) and modernizr, the first line would be

\\
\\ http://code.jquery.com/jquery-1.7.1.js 
(function( window, undefined ) {

})( window );
\\ http://www.modernizr.com/downloads/modernizr.js
window.Modernizr = (function( window, document, undefined ) {

})(this, this.document);
\\

To overcome the issue of undefined, these libraries passing undefined as local variable. Notice the third parameter is left blank.

Read my another post regarding the same topic.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: