4 ms·
Nice article but, am I the only one shocked by the lack of semicolons in the given examples?
by Halfman 11y ago
Nice article but, am I the only one shocked by the lack of semicolons in the given examples?
- krisdol 11y agoTry it! If you learn about why semicolons were recommended for js, it's pretty easy to avoid writing code that would land you in trouble in the semicolon-free world. Most likely you wouldn't be getting in trouble in the first place since most of the examples had me thinking "why would I ever write code like this?". Besides, I think that recommendation maybe came from a time when the ASI was unreliable and linters were not common. My eslint is awesome at keeping me out of trouble. For good reading, have a look at the linked articles at the bottom here http://eslint.org/docs/rules/semi.html http://eslint.org/docs/rules/semi.html
- glenjamin 11y agoThere are a few scenarios where you can get bitten by missing out semicolons. However, this eslint rule should save you: http://eslint.org/docs/rules/no-unexpected-multiline http://eslint.org/docs/rules/no-unexpected-multiline
- woah 11y agoI stopped using semicolons a year ago, have not had a single error because of it.