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.
Multi line comment are bad used without care in JavaScript, How?
You can comment in two ways in JavaScript code.
1) First one is to comment single line. For that we use two front slashes like //. Then the entire line will be considered as comment
Example
2) Second one is to comment multiple lines. For that we use start with /* and end with */
Example
So, where is the shock???
When you are using regular expression, be careful because you may encounter error.
So even when using comments, you should be careful…
Hope this will help…