what means this javascript code function -


this question has answer here:

(function () {     // somethig })(); 

what means function in parentheses? ()(); developers creates functions in js files directly.

what means function in parentheses? ()();

that means self-invoking function in javascript.

notice the: (); - calling.

your function, anonymous btw, invoked automatically without caller intervention, itself, once it's declared.

in addition, @thilo suggested, isolated scope local variables.


Comments

Popular posts from this blog

html - jquery - p element wont show after I hid it -

python - BeautifulSoup: How to get the nearest tag -

php - Return Last Insert ID with PDO -