3 ms·
(Apologies for the delay, I had to wait to respond since the lovely people in this discussion have downvoted me) Yes, people like to bring up these goofball ed
by draw_down 11y ago
(Apologies for the delay, I had to wait to respond since the lovely people in this discussion have downvoted me)
Yes, people like to bring up these goofball edge cases that don't actually happen in real life. Tell me, when was the last time you mapped over an array literal?
I'm serious, it has been years now, it is ok not to use semicolons in Javascript. People just need to... unclench. It is ok not to use them. I don't know what hellfire and brimstone people expect to happen when they stop using semicolons but it isn't going to happen.
The for-loop thing is that semicolons are required to delimit the initialization, condition, and increment of a for-loop. So you use them there.
See, this is the thing - not using semicolons to terminate statements is nicer than using them (pure opinion of course), and it doesn't cause problems in practice. But it would be ridiculous to take some hard-line stance of "absolute zero semicolons ever". The point is not that we hate the semicolon glyph or something, the point is that you don't need them to terminate statements, so we don't.
- recursive 11y agoI do this... pretty damn frequently. They totally happen in my real life. (function(a1, a2) { // something })(arg1, arg2);