Answer the question
In order to leave comments, you need to log in
Why does an anonymous function need to be wrapped in parentheses?
why write like that?
;(function (argument) {
// some code
})
Answer the question
In order to leave comments, you need to log in
In the case of code concatenation from multiple files by assemblers, where this may lead to an error in the resulting code. Specifically, in this example, the function is meaningless. it cannot be called.
Because you wrote it wrong
Anonymous function calls itself
So right:
;(function (argument) {
// some code
})()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question