Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: