It's a hacky way to immediately execute an anonymous function. If you were to define it normally (line starting with function
, then it would immediately hoist the function as a function statement and force you to call it normally. Since the ! is in front of it, that lets the compiler evaluate it as a function expression, which can be invoked immediately. The exclamation mark here is the boolean not
. Parenthesis or a plus sign would also work.
This would be equivalent code:
(e,n,t) => { /** */ }(window, angular, jQuery);
as would
(function (e,n,t) { /** */ })(window, angular, jQuery);
since the parenthesis will make the line be evaluated as an expression as well.
The anonymous function is being defined, and then called with the parameters window, angular, jQuery
, which become e,n,t
inside the function body.
Side note: I would not recommend writing functions like this, since it's uncommon syntax