News for hackers. Stuff that matters.
Re:A Prettier JavaScript Formatter by k__ on Tuesday January 10, 2017 @01:27PM (#13367422)
JavaScript has automatic semicolon insertion (ASI).

This will add semicolons all over your code depending on some rules, for example, if you write a return, and write the value you want to return in the next line, it adds a semicolon after the return AND after the value, effectively ignoring the value in the end.

    return
      myValue;
becomes

    return;
      myValue;
It's a bit meh, because you have to remember these rules even if you use semicolons.

There are no comments on this comment yet.