Came through a convention that I have never seen. What is it doing ?! function

I just chatted and analyzed some code in the source of some sites, and I came across this convention for an anonymous function.

!function(window){
     //so a bunch of stuff
}(this)

I have never seen the use of a function! for an anonymous function. What is he doing and why should anyone use it?

UPDATE2: my apologies, after additional testing, the following thread pretty much summarizes its use:

What does an exclamation mark do before a function?

+3
source share

Source: https://habr.com/ru/post/1525352/


All Articles