function mogla() {
//do it
}
// an anonymous function
(function () {
//do it
});
// a self invoked anonymous function
// it will be executed immediately, when the interpreter will reach this line
(function () {
//do it
})();
// a self invoked anonymous function with a parameter called "$"
// It means, that the interpreter will invoke this function immediately,
// and will pass jQuery as parameter, which will be used inside the function as $.
var jQuery = 'I\'m not jQuery.';
(function ($) {
console.log($)
})(jQuery);