file.js:
(function(m) {
//some
//code
//here
}(m))
I can't get what does this construction mean?
file.js:
(function(m) {
//some
//code
//here
}(m))
I can't get what does this construction mean?
That code defines a function inline and it immediately executes it.
Think about it by substituting the function for a variable:
(function(m) {
//some
//code
//here
}(m))
Then that's the same as:
var f = function(m) {
//some
//code
//here
}
(f(x))
But without having to define the f
.