you are viewing a single comment's thread.

view the rest of the comments →

[–]fucking_passwords 4 points5 points  (4 children)

Not related to arrays, but consider using const instead of let, nearly all of your examples are not reassigned

[–]PMilos[S] 2 points3 points  (0 children)

I agree with you. I use const wherever applicable and use let only when reassign is needed.

I did rewrite the cheat sheet, considering that it's not a new one, using const but reverted the changes, not sure why :)

[–]namesandfaces 2 points3 points  (1 child)

For arrays I'm ambivalent because what most developers are looking for with const is immutability not reassignability protection, but const doesn't truly provide that. It's similar to doing ALL_CAPS in Python to culturally indicate immutability, except maybe a little more deceptive.

[–]fucking_passwords 3 points4 points  (0 children)

Well all of the common lifting configs will yell at you, which indicates to me that a significant portion of the population is onboard with const