Hacker News new | ask | show | jobs
by XeO3 1046 days ago
> In general, if a statement begins with (, [, /, +, or -, there is a chance that it could be interpreted as a continuation of the statement before, if semicolon isn`t provided.

While /, +, and - are rare in the beginning of the statement, ( and [ aren't.

1 comments

That list is missing ` from ES2015+ template literals.

I enjoy teaching this to junior developers as the "winky frown rule" because that is a silly name that sticks in your memory and does help you remember it. Lines that start with an emoticon frown must wink:

    ;(    ;[    ;`