I was looking at some jQuery UI code, a found a weird behavior there:
jQuery.ui||(function(a){ /*... */ })(jQuery);;
The logical OR is clear for me, the function wrapper (still searching the correct name for it), too, but why two开发者_Go百科 semicolons?
Thanks in advance
Vincent
EDIT: Just found a another weird thing: In the version on google apis is only one semicolon. But when you create your on build on http://jqueryui.com/download, there are two semicolons.
Breaking it down:
// make sure that any previous statements are properly closed
// this is handy when concatenating files, for example
;
// Call the jQuery.ui object, or, if it does not exist, create it
jQuery.ui || (function($) {
reference
Typo? I cannot think of any valid reason.
That must either be a bug or a misunderstanding. Two consecutive semicolons do not make sense.
精彩评论