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

java - How to print docx and pdf? -

qml - Is it possible to implement SystemTrayIcon functionality in Qt Quick application -

java - IntelliJ to move a class along with conflicted classes to a new package? -