I found this syntax in the simple, great, wonderful and powerful library knockoutjs:
!function(factory) { ... }
What is the meaning of the not sign (!) before the function declaration?
UPDATE: The source code no longer contains this exact syntax.
The
!operator behaves as normal, negating the expression. In this case it is used to force the function to be a function expression instead of a function statement. Since the!operator must be applied to an expression (it makes no sense to apply it to a statement, because statements don’t have a value), the function will be interpreted as an expression.This way it can be executed immediately.