The correct syntax for an IIFE is (function() { })(). The first set of parentheses (function() { }) turns the function into an expression, and the second set of parentheses () immediately invokes that function. An alternative but equally valid syntax is (function() { }()). Both forms work because they ensure the function is treated as an expression rather than a declaration, which is necessary for immediate invocation. Without the wrapping parentheses, the JavaScript engine would interpret it as a function declaration and throw a syntax error when encountering the invocation parentheses.