!function () {}();
Exclamation mark makes any function always return a boolean.
The final value is the negation of the value returned by the function.
!function bool() { return false; }() // true
!function bool() { return true; }() // false
Omitting !
in the above examples would be a SyntaxError.
function bool() { return true; }() // SyntaxError
However, a better way to achieve this would be:
(function bool() { return true; })() // true