javascript - Can't get some JS syntax -


this question has answer here:

file.js:

(function(m) {     //some     //code     //here }(m)) 

i can't construction mean?

that code defines function inline , executes it.

think substituting function variable:

(function(m) {     //some     //code     //here }(m)) 

then that's same as:

var f = function(m) {     //some     //code     //here } (f(x)) 

but without having define f.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -