4 ms·
Semicolons are usually optional in JS. The 'usually' part if why it's a good idea to enforce usage of them to avoid situations like this. You don't even need to
by Legogris 8y ago
Semicolons are usually optional in JS. The 'usually' part if why it's a good idea to enforce usage of them to avoid situations like this.
You don't even need to do IEEs for this - running a function on an inline-declared array has a high probability of creeping the array up as an index on the previous expression.
- adrianhel 8y ago> Has a high probability of... No. It either does or it doesn't. The spec is not ambigous. Learn how ASI works, or you will run into trouble no matter if you prefer semis or not.
- Legogris 8y agoYou misinterpreted my statement - it will or will not make a difference depending on the line before. The spec is not ambiguous but for someone who does not know this there is probability at play.