Possible Duplicate:
What does the exclamation mark do before the function?
What's the point of the !
in the snippet bellow?
!function ($) { // code }(window.jQuery);
This syntax is used extensively in Twitter's bootstrap.js
Possible Duplicate:
What does the exclamation mark do before the function?
What's the point of the !
in the snippet bellow?
!function ($) { // code }(window.jQuery);
This syntax is used extensively in Twitter's bootstrap.js
they are calling the function right after the declaration (with window.jQuery as a parameter)
another syntax is:
(function ($) {
// code
})(window.jQuery);
some people care more about one character than readability