Wirks every time

68 points · 7 comments · view on lemmy.world

7 Comments

LiPoly@lemmynsfw.com · 14 pts · 1y

Tell me you’re a JavaScript StackOverflow copy-pasta noob without telling me you’re a JavaScript StackOverflow copy-pasta noob.

Scoopta@programming.dev · 9 pts · 1y (2 replies)

I don't get it? When has this ever fixed a bug? Compiler error sure? But a bug?

Eranziel@lemmy.world · 2 pts · 1y (1 reply)

Semicolons are technically optional in JS, but there are some rare cases where omitting them can result in different behaviour.

And this is why you should enforce code style, kids. Preferably with an automated tool.

Excigma@lemmy.world · 1 pts · 1y

I'm on my phone rn so can't format well, but one such example is:

const thing = require("module")

(async () => { something })()

without a ; at the end of the first line, JavaScript will try to do require("module")() instead

tatterdemalion@programming.dev · 7 pts · 1y

This type of shit makes me aware that there really are devs that don't care about efficiency and will spend weeks on some really novice shit because their tools and skills are bad.

daniskarma@lemmy.dbzer0.com · 2 pts · 1y

print("here");

0x0@programming.dev · 1 pts · 1y

Good tip for Pascal.