r/javascript • • Feb 05 '11

Are Semicolons Necessary in JavaScript?

http://aresemicolonsnecessaryinjavascript.com/
0 Upvotes

66 comments sorted by

View all comments

1

u/mitsuhiko Feb 06 '11

Yes, they are necessary: http://oss.org.cn/ossdocs/web/js/es4/rationale/syntax.html

(Unfortunately they are not, but if we all would place them properly we might be able to get rid of virtual semicolon insertion at one point.)

1

u/pyalot Feb 06 '11

Actually go and read the virtual semicolon heuristic that the various (open source) javascript engines do. Not only is it a good idea to do the semicolons yourself, pretty much every javascript engine implements a different heuristic.