Yes, you are not doing the second.
In the first example, you declare an anonymous function that runs after that without parameters.
In the second example, you simply declare it, but do not run it.
() - , , .
:
(function () {
})();
:
(function () {
});
, , :
(function (c) {
c.log("hello");
})(console);
: , - .
Edit:
@Osman , IIFE.
, : IIFE, .