The parentheses wrap around an anonymous function, in order to make it a variable that can be called directly by adding the parameters after it.
(function(param) {
// do stuff
})(param);
The bit at the end is not a namespace, just a parameter. You have probably seen this used for jQuery as:
(function($) {
$('.something').addClass('.other');
})(jQuery);
What this does is pass the jQuery object in to the function, making the $
variable the jQuery object in within the scope of the anonymous function. People like to use the shorthand $
, but it can lead to conflicts with other libraries. This technique removes the possibility of a conflict by passing the fully qualified jQuery
object in and overwriting the $
variable within the scope of that function, so the shortcut can be used.