How to do without the semicolon in this case?

Somehow from the start, accustomed to write without semicolons, but what to do in this case?

let initialY = (window.innerHeight / 2) - pageY
[].slice.call(layers).forEach(function (layer, i) {
 let layerStyle = layer.style
 let transformString = `translate3d(${initialX}px, ${initialY}px, 0)`
 layerStyle.transform = transformString
})


webpack complains if I do not put semicolon after the first line.
June 14th 19 at 20:44
2 answers
June 14th 19 at 20:46
Solution
Instead [] Array to write.prototype
But do join the previous response - the rejection of semicolons is some kind of manic save on matches.
I don't know about savings, but is this thing will work when js minification is a big question.
Without the semicolon separator is possible is not obvious behavior before some operators. - Justice commented on June 14th 19 at 20:49
The abandonment of semicolons only for readability of the code. I hate to see a bunch of unnecessary noise in the code.

With ineficacia not a single problem, except for such rare situations.

seems you've been on cequery not overlap? - lesly_Lindgren commented on June 14th 19 at 20:52
For Array.prototype - thank you. - lesly_Lindgren commented on June 14th 19 at 20:55
With ineficacia not a single problem, except for such rare situations.

Kind of a contradictory phrase, don't you think? - Evie commented on June 14th 19 at 20:58
no contradictions. It's not happening quietly, instantly revealed the reason that can be addressed. I for the first year faced at all. - lesly_Lindgren commented on June 14th 19 at 21:01
June 14th 19 at 20:48
to wean and how to write properly. And right with ;.
Who said it right? - Justice commented on June 14th 19 at 20:51
I, an hour ago. - lesly_Lindgren commented on June 14th 19 at 20:54
your intelligence is clear , but what if a more adequate developers will have questions, for them I'll leave the link here: https://learn.javascript.ru/coding-style - lesly_Lindgren commented on June 14th 19 at 20:57
funny to hear comments about the intelligence of a man with a picture of spongebob on your avatar. - Evie commented on June 14th 19 at 21:00
I'm coding style, some Jews from the former USSR, if I have other standards before the eyes relating to ES6 directly? - lesly_Lindgren commented on June 14th 19 at 21:03
,
On it I perhaps will finish:

https://github.com/elierotenberg/coding-styles/blo...

https://github.com/airbnb/javascript#semicolons - lesly_Lindgren commented on June 14th 19 at 21:06
who lives at the bottom of the ocean? - Justice commented on June 14th 19 at 21:09

Find more questions by tags JavaScript