They are exactly the same. There is no difference whatsoever between the two in terms of efficiency, output, or use. Using either one is a matter of preference.
Though there is a shorter variation of the two forms commonly used by JS minfiers. That is, logical NOT
-ing the function expression and calling it:
!function() {
console.log( x );
}();