javascript - Self Executing Anonymous Function Syntax -
i write js self executing anonymous functions
(function(){})()
but other day saw this, in somebody's code
(function(){}())
what's difference, , 1 recommended on other?
(function(){}());
i recommended one, because makes more sense.
you have function function(){}
append ()
execute it, wrap whole thing in ()
specify it's expression. done js interpreter not define function declarations, function expression.
but doesn't matter, execute properly, it's personal taste problem.
Comments
Post a Comment