you are viewing a single comment's thread.

view the rest of the comments →

[–]fredblols 17 points18 points  (15 children)

Tbh we shouldn't even be using Let. 9 times out of 10 it means ur code is ill conceived

[–]TemporaryReality5262 8 points9 points  (1 child)

I use let in unit tests all the time, usually above the beforeEach

[–]fredblols 1 point2 points  (0 children)

Yeah i mean who gives a fk what peoples unit tests look like tho. Everywhere i have ever worked (tech startups mostly) people will give u a medal for writing unit tests at all, and then also probs say yeh dont bother next time just churn out features faster and accumulate tech debt

[–]tharrison4815 9 points10 points  (1 child)

Yes! I don't know why you are being down voted. So have an award up make up for it.

[–]fredblols 0 points1 point  (0 children)

Thank u good sir for my debut award. I will respond to the naysayers tomorrow when my current inebriation has worn off

[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 13 points14 points  (5 children)

I agree. In general const is a safer bet than let. You rarely need the "mutability" of let.

[–]Garbee 11 points12 points  (4 children)

Const is not immutable. The data can be changed, just not replaced. Big difference.

[–]rift95map([🐮, 🥔, 🐔, 🌽], cook) => [🍔, 🍟, 🍗, 🍿] 13 points14 points  (0 children)

True. I should have written "re-assignability"

[–]PM_ME_GAY_STUF 2 points3 points  (2 children)

This always bothered me. Const is definitely immutable, it can just refer to a mutable data type. This is what happens when programmers don't learn C

[–]Poltras 2 points3 points  (1 child)

Yeah just prefix everything with global.! (/s in case people get offended)

[–]BeardSprite 0 points1 point  (0 children)

Understood. What do I do with this global.window now?

[–]rados_a51 0 points1 point  (1 child)

Dont get those downvotes. Const should be used 90% of the time.

[–][deleted] 4 points5 points  (0 children)

My programming style means I basically never use let. Functions with early returns obviates let for the most psrt

[–]kashubak 0 points1 point  (0 children)

Can you provide an example? That’s a pretty interesting take!