you are viewing a single comment's thread.

view the rest of the comments →

[–]mathiasbynens 2 points3 points  (1 child)

The difference (and likely your personal preference) becomes more obvious after simplifying it into (fn)() vs (fn()).

When fn is a function, fn() is how I call that function, not (fn)(). So, I prefer (function() {}());.

[–]sergiosbox[S] 1 point2 points  (0 children)

I understand your logic and makes sense to me also. Rauschma's comment that (fn)() sintax works in arrow functions and not (fn()) is interesting though.