TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Semicolons in JavaScript are optional (2010)

1 pointsby hnmcsover 10 years ago

2 comments

hnmcsover 10 years ago
Only reason I posted this was that I got fooled by the brand-new "search" interface on HN when I was checking if it had been posted before. I got results for only the past 24 hours, but interpreted it as results for all time.
hnmcsover 10 years ago
summary &#x2F; teal-deer:<p>Provocative author says: you never need semicolons in JS, so don&#x27;t feel you have to use them. Free your mind from the cargo cult. Provocative author admits that you do need them to get something like this to parse correctly:<p><pre><code> a = b + c (d + e).print() </code></pre> And then recommends using semicolons in this way:<p><pre><code> a = b + c ;(d + e).print() </code></pre> &lt;&#x2F;summary&gt;<p>Frankly, I&#x27;m not persuaded.