3 ms·
I don't trust someone that uses let where you should be using const.
by dalmo3 4y ago
I don't trust someone that uses let where you should be using const.
- justinpombrio 4y ago`const` prevents surface-level mutation (though you can still modify the parts of the thing). `let` has sane scoping rules. Sadly neither has both: `let` is fully mutable and `const` has crazy scoping rules. So using `const` over `let` isn't a strict improvement.
- MisterKent 4y agoSource? Their scoping rules should be exactly identical....
- dalmo3 4y agoThat's new to me. What's crazy about the scope of const?
- justinpombrio 4y agoWow, I just completely misremembered that. Sorry!
- seniorsassycat 4y agoLet and const have the same scope, var is the one with weird rules
- e12e 4y agoI see many uses of const, and a few let's - which ones would you change to const?
- hLineVsLineH 4y agoA better question would be: which ones would you not change to `const`?