What is the difference between these two syntaxes? Are they both closures?
[duplicate]
This question already has an answer here:
Are "(function ( ) { } ) ( )" and "(function ( ) { } ( ) )" functionally
equal in JavaScript? 3 answers
I have seen both of these syntaxes (the second one a lot more though)
Is there a difference? Are they both behaving the same way?
(function() {
// code
}())
(function() {
// code
})()
No comments:
Post a Comment