Hacker News new | past | comments | ask | show | jobs | submit login

In most cases[0], Js "looks" at the next line to see if it could continue the current statement, in which case no semicolon is inserted.

[0] Not true for "restricted productions", which include naked returns, and some other "special" cases.




What do you mean?

Would

    return list.map(func1)
               .filter(func2);
work?


Yes, but this

   return
      list.map(func1)
          .filter(func2);
has never worked in the history of JS because JS terminates the return at the newline and returns undefined.




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

Search: