3 ms·
> You get to the end and all of a sudden the }(); With most code conventions, you wrap immediately invoked function expressions (IIFEs) in parens: var foo =
by ahoge 11y ago
> You get to the end and all of a sudden the }();
With most code conventions, you wrap immediately invoked function expressions (IIFEs) in parens:
var foo = (function () {
...
}());
The only purpose of those extra parens is to act as marker.
Well, with block scope (`let` & `const`), IIFEs aren't really needed anymore.