You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
- I'd be interested to know why this has received downvotes. JavaScript doesn't need semi-colons to terminate statements; it can certainly use them, but they are by no means a requirement. If they were needed, then nobody else's explanations would work. The fact(yes, a fact) that you can write an entire JavaScript application with few to no semicolons demonstrates this. Beyond that, I don't see how understanding how a tool works and using one's own reasoning to make decisions is somehow objectionable in contrast to "just do it". That's what's known as religion.Ten Bitcomb– Ten Bitcomb2015-08-27 23:28:36 +00:00Commented Aug 27, 2015 at 23:28
- 7I didn't downvote, but the issue might be that this is factually not correct as written. Newlines are not considered statement terminators in javascript. You can leave off semicolons because of a feature called automatic semicolon insertion which allows it to fix parse errors automatically in certain circumstances. The people who advocate semicolons argue that many javascript programmers seem to poorly understand this rule. Your post seems to be an argument in their favor in that light. (In fairness, I mostly agree with your thesis, but for different reasons)Tim Seguine– Tim Seguine2018-04-26 21:13:51 +00:00Commented Apr 26, 2018 at 21:13
- 1@TimSeguine Yeah, I wrote this back before I had a better understanding. I still don't think it's objectively wrong to not use semicolons so long as the people doing so understand what exactly it is that they're doing. I should rework my post, or perhaps get rid of it since enough others have chimed in about this. Thanks for the polite criticism! :)Ten Bitcomb– Ten Bitcomb2018-04-26 23:21:28 +00:00Commented Apr 26, 2018 at 23:21
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. design-patterns), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you
lang-js