3 ms·
I always use semicolons to end lines in JavaScript because it is comfortable for me. ...and I always feel a little guilty about it, because it seems wrong to a
by jpadvo 16y ago
I always use semicolons to end lines in JavaScript because it is comfortable for me.
...and I always feel a little guilty about it, because it seems wrong to add superfluous characters to my code. Is it actually "personal preference" and I've been feeling guilty for nothing, or is it better to leave off the semicolons?
- roryokane 16y agoSee my reply to someone else, describing the advantages and disadvantages of omitting semicolons: http://news.ycombinator.com/item?id=2184289 http://news.ycombinator.com/item?id=2184289 As for whether you should omit the semicolons, only you can decide how much those pros and cons affect you. Depending on how much you care about others who read your code, you might also want to consider how you think those other people would choose, if they evaluated those pros and cons for themselves.