Comment

Comment by Nitramp

Not having to use semicolons sounds nice, but in practice it can have terrible effects. E.g.:

  var x = function() {
    // something
  }
  
  // avoid polluting global scope:
  (function() {
    // Some initialization.
  })()
This will call the function x with the anonymous function as its argument, and then call the result of that.

There are more examples to that point, and many of them really aren't all that straightforward. So don't rely on automatic semicolons.

parent Nitramp 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton