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.

JavaScript Semicolons Are Not Necessary

3 pointsby Lennuabout 9 years ago

3 comments

partycoderabout 9 years ago
From Google, authors of V8 and Chrome, if their opinion means anything to you: <a href="https:&#x2F;&#x2F;google.github.io&#x2F;styleguide&#x2F;javascriptguide.xml?showone=Semicolons#Semicolons" rel="nofollow">https:&#x2F;&#x2F;google.github.io&#x2F;styleguide&#x2F;javascriptguide.xml?show...</a>
alexc05about 9 years ago
I remember having a bug once in (I think) IE8 where I had a comma after the last element an an array (like the &#x27;greatarray&#x27; shown in this article.<p>The browser didn&#x27;t accept a comma after the last element in an array and IIRC the compiler breaks so badly that it puts the reported error at line 1 character 1, possibly for a different file entirely.<p>Spent a LONG time on that.<p>I kind of reject his assertion that JavaScript without semi colons is &quot;better code&quot;<p>The logic, flow, maintainability, understandability, performance and, actually doing the right thing all make for better code.<p>Semicolons? Not so much.
mcbitsabout 9 years ago
Semicolon presence or absence is usually the least annoying factor to me in how other people write their JavaScript code.